How can I get a script to run at a certain time every day using Windows 10 Task Scheduler?
22 次查看(过去 30 天)
显示 更早的评论
I am trying to get a script to run at the same time every day using the Task Scheduler program on a computer running Windows 10.
When I put the entire path to the script (C:\Users\Lab\Documents\MATLAB\work\JK\detectbouts\my_script.m) in the Program/script box, Matlab opens and gives me the following warning, but the script does not execute:
"Warning: Name is nonexistent or not a directory: C:\Users\Lab\AppData\Local\Temp\Editor_rstil". There is no "AppData" folder, and I'm not sure why this warning pops up.
I have also tried putting "matlab" into the Program/script box, and "-r C:\Users\Lab\Documents\MATLAB\work\JK\detectbouts\my_script.m" with the same result.
How can I get this script to actually run?
0 个评论
采纳的回答
Deepak Meena
2021-1-27
Hi Jonathan,
The command should be
matlab.exe -r "run <filePath>"
so in your case , command should be
matlab.exe -r "run C:\Users\Lab\Documents\MATLAB\work\JK\detectbouts\my_script.m"
Put this command in Program/Script box. I tried the steps above and it worked for me.
This would launch the MATLAB at the scheduled time and would run that script.
If you want to run the MATLAB session in the background , use the argument like -nodesktop and -nodisplay
Thanks
1 个评论
Polsak Tothong
2024-4-7
is there a way to export logfile with date time in log file name using task scheduler?
更多回答(1 个)
Tharikaa Ramesh Kumar
2024-6-11
Do you run time-consuming tasks on MATLAB and Simulink? Do you wish you could schedule them and run them in the background, unattended? How do you solve this question today?
MATLAB Product team is very interested to talk to you and learn from your experience. Please participate in this brief survey (6 questions).
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!