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

RunAsWait failed return value, but successful process

$
0
0
Hello!

Can someone offer some advice as to why this process is coming back as failed when it appears to be successful?  This is a process that needs to run under a non-administrative user account.

[ autoit ]      
$sUserName = "XXXXX" $sPassword = "XXXXX" Global $FileCopyINF $FileCopyINF = RunAsWait($sUserName, @ComputerName, $sPassword, 0, FileCopy("C:\Windows\INF\usbstor.inf", "C:\Windows\INF\usbstor.inf.old", 1), @SystemDir, @SW_HIDE) ;test output MsgBox(0, "Test", "Returned value for $FileCopyINF: ", $FileCopyINF)   If $FileCopyINF = 0 Then $CopyValueINF = "Failure" Else $CopyValueINF = "Success" EndIf MsgBox(0, "File Copy Results", 'Results of the File "Copy" process...' & @CRLF & @CRLF & " C:\Windows\INF\usbstor.inf................Rename to: usbstor.inf.old [" & $CopyValueINF & "]") Exit

The test message output = 0 and the results message comes back as [Failure], but a copy of the file is created.

Before:
usbstor.inf

After:
usbstor.inf
usbstor.inf.old

I'm sure this is just a simple brain freeze on my end but I don't want to push forward without understanding the output.

Thanks!

Viewing all articles
Browse latest Browse all 12506

Trending Articles



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