Jump to content

Fire Off .exe On Remote Machine


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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...