cntour Posted March 4, 2009 Share Posted March 4, 2009 I need to create scheduled task with administrative privilege locally: For example, PC1 is logged on by regular user who doesn't have administrative right, if he run the program I give him, he can add scheduled task on his machine. Local $sUserName = "administrator" Local $sPassword = "admin_password" local $sDomain=@ComputerName local $sProgram = "schtasks /create /RU administrator /RP ""admin_password"" /sc Weekly /D MON /tn ""sdsystem"" /tr ""shutdown -f -s -t 600 "" /ST 05:30:00" runas($sUserName,$sDomain,$sPassword,0, $sProgram) it doesn't work. Could you give me some advice? Thanks a lot. Link to comment Share on other sites More sharing options...
cntour Posted March 4, 2009 Author Share Posted March 4, 2009 Could I go back to use runasset instead of runas in the new version? TY. Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 4, 2009 Share Posted March 4, 2009 Could I go back to use runasset instead of runas in the new version?TY.What difference would that make?Did you try providing the full path to SchTasks.exe in your command line, and a working Dir parameter? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now