Wednesday, September 12, 2018

Running batch files in windows task scheduler

Good information for starting batch files in windows ... be sure to read the comments at each page for further clarification.

From here: https://stackoverflow.com/questions/4437701/run-a-batch-file-with-windows-task-scheduler

I faced the same problem, but I found another solution without having to modify my batch script.

The only thing that I missed out is at the 'Action' settings - "Start in (Optional)" option.

Go the task properties --> Action tab --> Edit --> Fill up as below:

Action: Start a program
Program/script: path to your batch script e.g. C:\Users\beruk\bodo.bat
Add arguments (optional):
Start in (optional): Put the full path to your batch script location e.g. C:\Users\beruk\(Do not put quotes around Start In)
Then Click OK

It works for me. Good Luck!

And from here : https://stackoverflow.com/questions/20254666/keep-command-line-window-open-when-running-scheduled-task-executing-batch-file

In the Scheduled Task dialog, just before the name of the batch file it's going to run (it's labeled Program/script. You now have something like:

myscript.bat
Change it to

cmd 
Add the following to the **Add Arguments (optional) entry:

/k "C:\My Batch File Folder\MyScript.bat"
Tested on my system (Win7 64-bit), and it worked perfectly. I'm looking at the open command window it created as I type this text. :-)

Helped me!

No comments: