Scheduling a batch file to run
For example, I wanted to automatically delete files and folders in a given folder after I log into the system. You cannot do that directly with the task scheduler. So, I created a batch script and used the task scheduler to execute that batch file on schedule. Just follow the below steps to schedule a batch file in Task Scheduler in Windows. Scheduling a batch file with Task Scheduler is way easier than you think.
Just follow the steps shown below and you will be good. First, make sure that you have the batch script ready and stored in a safe place. The location is important because if the file is moved or deleted from that location, the task will not run. Note the other options. For most tasks, the default values are sufficient. Be aware that you can make these changes if needed. We selected Daily for this example. You can also decide when the schedule starts and recurs.
The last two are deprecated and not supported options anymore. Leave it on the default Start a program. Enter the full path to the script. Use the Browse button to go to the script, and select it. The Add arguments and Start in fields are blank. You might use these when you progress to more complicated scripts and tasks.
Select OK to continue. When the task finishes, look at the Last Run Result column. You should see The operation completed successfully. If it says anything else, try using the F5 button to refresh the screen. Click Scheduler in the Systems panel of the Admin page. At the bottom of the default screen, you will see the contents of the commands you need to add to a batch file.
Open notepad. Click OK. From the command prompt, type or paste in the first line of the. Hit Enter. You should now be at your SugarCRM directory.
0コメント