Jump to content

Fire Off .exe On Remote Machine


lugos

Recommended Posts

Hello,C# newbie here. I am running an executable on a remote machine with the following code:

Process remoteProcess = new Process();ProcessStartInfo remoteProcessStartInfo = new ProcessStartInfo();remoteProcessStartInfo.CreateNoWindow = true;remoteProcessStartInfo.ErrorDialog = false;remoteProcessStartInfo.RedirectStandardError = false;remoteProcessStartInfo.RedirectStandardOutput = false;remoteProcessStartInfo.UseShellExecute = false;remoteProcessStartInfo.FileName = "\\\\<remote_machine>\\winnt\\NOTEPAD.EXE";remoteProcess.StartInfo = remoteProcessStartInfo;remoteProcess.Start();remoteProcess.WaitForExit();remoteProcess.Dispose();

This accomplishes part of what I want to do. However, what I am seeing is that notepad is opening up on my local machine. It almost looks like it's downloading an instance of the notepad exe and running it locally. What I am looking to do is run it on the remote machine and have it open up there.Any assistance/direction would be greatly appreciated.Thanks in advance.

Link to comment
Share on other sites

Hello,C# newbie here. I am running an executable on a remote machine with the following code:
Process remoteProcess = new Process();ProcessStartInfo remoteProcessStartInfo = new ProcessStartInfo();remoteProcessStartInfo.CreateNoWindow = true;remoteProcessStartInfo.ErrorDialog = false;remoteProcessStartInfo.RedirectStandardError = false;remoteProcessStartInfo.RedirectStandardOutput = false;remoteProcessStartInfo.UseShellExecute = false;remoteProcessStartInfo.FileName = "\\\\<remote_machine>\\winnt\\NOTEPAD.EXE";remoteProcess.StartInfo = remoteProcessStartInfo;remoteProcess.Start();remoteProcess.WaitForExit();remoteProcess.Dispose();

This accomplishes part of what I want to do. However, what I am seeing is that notepad is opening up on my local machine. It almost looks like it's downloading an instance of the notepad exe and running it locally. What I am looking to do is run it on the remote machine and have it open up there.Any assistance/direction would be greatly appreciated.Thanks in advance.

I found that this isn't possible. But I may be able accomplish my goal by creating a scheduled task for the executable and then start it through my application.Thanks.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...