Is there anyway to run a command from within the script yet retain the admin privileges of the original script?
The results should be all zero's (success) but the RunAsWait function loses the admin privileges and the commands fails.
edit: I have tried all 4 logon flags.
The results should be all zero's (success) but the RunAsWait function loses the admin privileges and the commands fails.
[ autoit ]
#RequireAdmin $RunWaitResult = RunWait(@ComSpec & " /c net session") $RunWaitErrorResult = @error $RunAsWaitResult = RunAsWait("username","domain","password",4,@ComSpec & " /c net session") $RunAsWaitErrorResult = @error MsgBox(0,"Results", _ "$RunWaitResult = " & $RunWaitResult & @CRLF & _ "$RunWaitErrorResult = " & $RunWaitErrorResult & @CRLF & _ "$RunAsWaitResult = " & $RunAsWaitResult & @CRLF & _ "$RunAsWaitErrorResult = " & $RunAsWaitErrorResult ) #cs **** OUTPUT --------------------------- Results --------------------------- $RunWaitResult = 0 $RunWaitErrorResult = 0 $RunAsWaitResult = 2 $RunAsWaitErrorResult = 0 --------------------------- OK --------------------------- #ce
edit: I have tried all 4 logon flags.