I have the following code snippet... I am trying to figure out why it displays the first message box even if the command fails. Also, I would like it to keep the CMD window open after running psexec until the user hits any key to continue. Thanks!
Set objShell = CreateObject("WScript.Shell")
btn_settz.disabled = True
btn_rename.disabled = True
sOldName = txt_oldname.Value
sNewName = txt_newname.Value
intReturn = objShell.Run("c:\windows\system32\psexec...
If intReturn = 0 Then
MsgBox "Please Check CMD window if rename was successful"
MsgBox "Rename failed with return code " & intReturn