Jump to content

Windows Task Scheduler question


RickB75
 Share

Recommended Posts

Hi guys. I have  a quick question. I have a cmd line to create a scheduled task and to use the user account "SYSTEM". My script can run in the BG with no problem. I'm just wondering If user "A" downloads the compiled .EXE, will the scheduled task still run the .EXE that was downloaded since the scheduled task is set to use the "SYSTEM" account??

Just wondering.

Link to comment
Share on other sites

  • 7 months later...

I know this thread is a few month old. I do have another question very similar to this question. I got the task scheduler to work using this line of code. 

RunWait("SCHTASKS /Create /SC DAILY /ST 04:00 /SD 01/29/2015 /TN RicksUpdate /TR " & @ScriptDir & "\Update.exe /RU SYSTEM")

In the last param (/RU SYSTEM), I have it scheduled to run  as a system task. By doing this it allows the exe to run weather the user is logged on or not. On my work PC it works flawless. On my personal though, thats another issue. I'm the admin on my personal pc. When I run this script nothing happens. If I copy the params, open CMD as the Administrator CMD and paste it in, it will schedule the task like it suppose to. 

Using the normal CMD, If I paste it in and remove "/RU SYSTEM", it will also schedule the task but it will not set the param to Run weather the user is logged in or not. It only sets the param to run when the user is logged in. 

 

My question is how can I schedule a task and set it to run weather the user is logged in or not even if they are not the administrator? If I am scheduling a task manually, i can choose that option in the task scheduler UI. 

 

Any Ideas???

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...