Jump to content

Fire Off .exe On Remote Machine


lugos
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...