Hey all, I'm trying to run an exe file ON A REMOTE MACHINE (not from, but ON).
I have very simple code as following:
ProcessStartInfo info = new ProcessStartInfo("C:\\PsTools");
info.FileName = "psexec \\\\" + machine.Name + "\\C\\Program Files\\test.exe";
info.RedirectStandardOutput = true;
info.UseShellExecute = false;
Process p = Process.Start(info);
When trying to run this code i get "The system cannot find the file specified" error.
- There is a file named "test.bat" on the specified directory.
- The remote machine is on the same domain and the C folder is shared (I'm the admin).
- I have PsTools installed and configured as environment variables.
- I have tried variety of codes (for example if i don't use "psexec" on the ProcessStartInfo constructor and on the FileName property, the bat file runs on the local machine instead of the remote one...) and nothing works!
any ideas?