Jump to content

Scheduled task under wrong user - works fine in CMD


Recommended Posts

So this is fairly simple.

I have this command to reboot at 11:30 PM

Run('schtasks /create /tn Reboot /tr "shutdown /r /t 120" /sc once /st 23:30:00 /ru %COMPUTER%\Administrator /rp ******')

The code works in CMD and AutoIT

But the problem is that when run via autoit it schedulesĀ it as the logged in user NOT the computer admin (weird) and therefore fails to run.

The reason I schedule it as admin is we are on domain and you need to type the user password to schdual a task - but we don't know the password.

If I use the DOMAIN admin in the script the task will schedual as domain admin and run - but I dont really feel comfortable putting the domain admin password into a script.

Link to comment
Share on other sites

  • 3 weeks later...

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

×
×
  • Create New...