objShell.Exec ("psexec.exe \\" & strComputerName & " -u " & strUsername1 & " -p " & strPassword & "cmd.exe")
Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strPSExec = "C:\Temp\PSExec.exe"
strPSExec = objFSO.GetFile(strPSExec).ShortPath
strComputer = "compname"
strUser = "user"
strPass = "pass"
strCmd = "cmd /k " & strPSExec & " -accepteula " & " \\" & strComputer & " -u " & strUser & " -p " & strPass & " cmd.exe"
objShell.Run strCmd, 1, True
If not, specify the full path:
Open in new window