Friday, February 13, 2009

Scheduler Task related

schedule hibernation (wait for 20 seconds):
ping -n 20 127.0.0.1 (gt) NUL 2(gt)(and)1 (2x and) shutdown /h /f
source: Hibernate computer from command line on Windows 7

Prevent batch/command in scheduled task from flashing/popping:
- Run task as another user, OR
- Use Windows scripting host
(Run a .bat file in a scheduled task without a window)

HOW TO: Modify a Scheduled Task to Repeat By Minutes or Hours

About exit/result code:
Application return codes are specific to the application that the task is running. the task moniter stores the last exit code, which is the code the application returns when it exits. When trying to decipher what the return code means for a specific application or patch, the documentation for that application or patch usually contains some relevant information.
source: Common Scheduled Task Questions
related: Windows system error codes

Sample case:
Scheduled task of shutdown.exe returns code of 45b
Convert 45b to decimal returns 1115
Looking that number up on Windows System Exit Code Description - 1000 to 1999 reveals that the real error was "A system shutdown is in progress."

No comments:

Post a Comment