Tuesday, November 5, 2013

5. Schedule a batch File/ Run a task at particular time



Batch files can be scheduled to run at particular time/ time frequency you want. Here is how it’s done.

Say you want to run batch file named “Test.bat”. 
Test.bat  opens a Microsoft word document named “AI.docx”. 
It contains following syntax.

start "c:\Program Files (x86)\Microsoft Office\Office14\winword.exe" C:\Users\Test_User\Documents\Curr\AI.docx

So you have batch file ready.

How to schedule:
1)      From windows search “Task Scheduler” and open it. 
2)      Click on “Task Scheduler Library” located at left of screen. Don’t forget this step. I had spent almost 30 mins to figure out where my created tasks are going.
3)      From Action menu click on Create task. Follow the self-explanatory tabs from there on.
4)      In Trigger tab you can give when your batch file would run. In Action Tab you have to give your batch file path.
5)      In Condition tab. Do not forget to Uncheck “Run task only on AC power option” . 

And that’s it, document AI.docx would open now at scheduled time.