Friday, December 26, 2008

Windows Scheduling tip

In some occasions, one might need to schedule a script or an executable in Windows using the SYSTEM (Local System account) privileges. I've shown before a technique to create a new schedule task for opening a cmd with SYSTEM privileges. But this time I want to show something which is way more flexible, and would suit real world examples (and not just opening a cmd).

Review the following command:
schtasks /create /tn task_name /tr c:\script_path\script_name.cmd /sc daily /st 08:00:00 /ru "System"

What does it do? It creates a new scheduled task, called "task_name", which runs a script (full path is a must) and would run daily at 08:00AM with SYSTEM privileges. Slick, right?

I recommend reviewing the schtasks manual for further information.

Happy scheduling.

No comments:

Post a Comment