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.

3 comments:

  1. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post. very good tool

    ReplyDelete
  2. Interesting topic for a blog. I have been searching the Internet for fun and came upon your website. Fabulous post. Thanks a ton for sharing your knowledge! It is great to see that some people still put in an effort into managing their websites. I'll be sure to check back again real soon.

    ReplyDelete
  3. Wow! This could be one of the most useful blogs we have ever come across on thesubject. Actually excellent info! I’m also an expert in this topic so I can understand your effort. bookmetoday.com

    ReplyDelete