Using:
cmd /c c:\PSTools\PsExec.exe
Will cause you to launch a cmd.exe
process which in turn launches the PsExec.exe
. You may think "Oh, but thats what I want" but its not.
The flag you use with cmd
actually does the following:
/C Run Command and then terminate
So immediately after the the PsExec.exe
process gets launched from the cmd.exe
, the cmd.exe
process is finished because its only job was to start the PsExec.exe
process and terminate. So from the Java standpoint, everything is done.
Just try running the PsExex.exe
directly and see if that returns the output you desire.