Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Scheduled task under wrong user - works fine in CMD

$
0
0

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.


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>