Executing a batch file, which in turn starts a process on the remote machine

Here I have 2 requirements:

  • You need a batch file to start the process on a remote machine.
  • C # to run batch file. I came across using a process data class, but I am confused about the WaitForExit call. Why should we call this method? If we don't call this method what happens?

source to share

2 answers

Start the process (just change this to point to the bat file):

how to start this process

And write a .bat file that does one of the things suggested here:

Run an application or process on a remote computer



From your requirement, don't call WaitForExit. It is only needed if you are waiting for the process to complete before continuing with your code. If you don't call, your program will continue as soon as you call Process.Start



All Articles