|25 Mar 2013||#1|
| || |
Scheduled Task / Batch Code on Windows Server 2008 R2 SP1
I have some processes that I need to stop and restart each morning. In order to do this, I've created 2 scheduled tasks inside Task Scheduler:
1.) Stop Foobar (Both Environments) - Triggers @ 6:45 AM Every Day
2.) Start Foobar (Both Environments) - Triggers @ 6:48 AM Every Day
Both tasks above make use of a respective *.BAT file to shut down and restart a task agent service. Unfortunately, the tasks have been bombing with "(0x5)" each morning. I'm not sure why, but I suspect it has something to do with the following code associated with each *.BAT file:
sc stop Foobar_f52d190a-0e84-4b3a-ab03-xsfc6450b845 timeout 10 sc stop Foobar_935feeac-b874-4cca-b8eb-xsf55881ffb2
sc start Foobar_f52d190a-0e84-4b3a-ab03-xsfc6450b845 timeout 10 sc start Foobar_935feeac-b874-4cca-b8eb-xsf55881ffb2
Any insight is appreciated. And I added the "timeout 10" in order to give the tasks some buffer between each task. Maybe it needs more? I dunno...
|My System Specs|
|Similar help and support threads for2: Scheduled Task / Batch Code on Windows Server 2008 R2 SP1|
|How can I set a scheduled task to minimize open windows before sleep?||General Discussion|
|Scheduled Task history indicates task completed successfully but....||Performance & Maintenance|
|Server 2008 Task to Send Mail||Browsers & Mail|
|Setting up home network server using windows server 2008 R2||Network & Sharing|
|Error Code 80073712--Windows Server 2008 update||Chillout Room|
|windows 7 scheduled task remote access||Network & Sharing|
|Best Antivirus in server windows 2008 server 2008 r2||System Security|
|Our Sites ||Site Links ||About Us ||Find Us |
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
All times are GMT -5. The time now is 03:44 AM.