I use PsExec for executing several command line programs, but when I call my own build C# (.net 4.0) console app, PsExec does hang, and will not finish...
When calling other console apps, PsExec will return output like this:
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
Connecting to localhost...
Starting PsExec service on localhost...
Connecting with PsExec service on localhost...
Starting [MyExe] on localhost...
[myExe] exited on localhost with error code 0.
But on my own C# console app only show this output:
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
My console app has some logging itself, and it executes fine, and exits with exit code 0 in about 2 seconds, but after 40 seconds, PsExec has still no output.
On the target machine the PsExecSVR is still installed, and running.
I've tried to exit the console app with
Environment.Exit();
And also removed this line, and let the console app exit on it's own (by letting void main to end on its own). But still no luck on PsExec.