JerichoJones Posted September 3, 2008 Share Posted September 3, 2008 I am hoping that I am missing something obvious. I cannot get the below code to work. It sure looks right to me but I have been staring at it for about two hours. $CopyINIFile returns 0 and @error returns 0. Shouldn't @error return a non-zero number on failure? The id, pass, vars are all good. help! $CopyINIFile = RunAs("UserID", "Domain", "Password",0, @ComSpec & " /C " & @SystemDir & "\System32\XCOPY.EXE \\" & $SiteServer & "\NetApps$\NTE\BSDNWEA.INI " & CHR(34) & @ScriptDir & CHR(34) & " /Y",@ScriptDir, @SW_HIDE, $STDERR_CHILD) If StderrRead($CopyINIFile) = 0 Then MsgBox(16,"BSD TestTaker","Local INI file could NOT be updated." & @CRLF & "Please contact the Service Desk for assistance @302-555-1234" & @CRLF & "Please reference this error during your call. Thanks!") Exit(1) EndIf Link to comment Share on other sites More sharing options...
JerichoJones Posted September 4, 2008 Author Share Posted September 4, 2008 I am hoping that I am missing something obvious. I cannot get the below code to work. It sure looks right to me but I have been staring at it for about two hours. $CopyINIFile returns 0 and @error returns 0. Shouldn't @error return a non-zero number on failure?The id, pass, vars are all good.help!$CopyINIFile = RunAs("UserID", "Domain", "Password",0, @ComSpec & " /C " & @SystemDir & "\System32\XCOPY.EXE \\" & $SiteServer & "\NetApps$\NTE\BSDNWEA.INI " & CHR(34) & @ScriptDir & CHR(34) & " /Y",@ScriptDir, @SW_HIDE, $STDERR_CHILD)If StderrRead($CopyINIFile) = 0 Then MsgBox(16,"BSD TestTaker","Local INI file could NOT be updated." & @CRLF & "Please contact the Service Desk for assistance @302-555-1234" & @CRLF & "Please reference this error during your call. Thanks!") Exit(1)EndIfIf I change the working dir to @SystemDir I at least get the cmd prompt to run but nothing happens and it returns nothing. This makes no sense. Link to comment Share on other sites More sharing options...
JerichoJones Posted September 5, 2008 Author Share Posted September 5, 2008 Bump... Anyone? Link to comment Share on other sites More sharing options...
JerichoJones Posted September 6, 2008 Author Share Posted September 6, 2008 rtfm.... closer Link to comment Share on other sites More sharing options...
therks Posted September 7, 2008 Share Posted September 7, 2008 The user you're trying to run as may not have access to the @ScriptDir folder. That would be my first idea. My AutoIt Stuff | My Github 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