title: How to execute process on remote machine, in C#
body: <p>How can I start a process on a remote computer in c#, say computer name = "someComputer", using System.Diagnostics.Process class?</p>
  
  <p>I created a small console app on that remote computer that just writes "Hello world" to a txt file, and I would like to call it remotely.</p>
  
  <p>Console app path: c:\MyAppFolder\MyApp.exe</p>
  
  <p>Currently I have this: </p>
  
  <pre><code>ProcessStartInfo startInfo = new ProcessStartInfo(string.Format(@"\\{0}\{1}", someComputer, somePath);
  
              startInfo.UserName = "MyUserName";
              SecureString sec = new SecureString();
              string pwd = "MyPassword";
              foreach (char item in pwd)
              {
                  sec.AppendChar(item);
              }
              sec.MakeReadOnly();
              startInfo.Password = sec;
              startInfo.UseShellExecute = false;
  
              Process.Start(startInfo);
  </code></pre>
  
  <p>I keep getting "Network path was not found".</p>