I would like to run a program (a batch file with an infinite loop inside) on a remote host using PSEXec, and continue execution afterwards. My problem is that when I run a command like:
psexec -d -u user -p password \\192.168.42.42 "D:\myscript.bat", the calling command-windows stays open, but does not return, because d:\mysscript.bat contains a loop that makes the process run infinitely (intentionally).
What I would like to achieve is a behaviour that I can start a process remotely, which keeps running on a remote system, but execution in the calling command-window continues (i.e. psexec returns even though the remote process is still running).
How can I achieve the desired behaviour with psexec? At the moment, the process on the caller side waits for the remote process to end, but does not return.
start
command to execute the batch? I don't know that it will work but it is the first thing that I would try. Also, is the useruser
logged in?.. what do you expect to happen if they aren't? Should the logged in session remain?