Run batch file on remote computer using PSExec and continue execution, don't wait for remote process to end

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.

1

1 Answer

Potentially just use nested batch files and use psexec to call a local batch on the remote machine?

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like