title: More than one important path for .NET Process
body: <p>In a project I'm currently working on, I am starting an external process. However, the external process is the EXE of a complex program which loads current-user information from a user folder. The desktop shortcut for the program resolves the matter by setting the "Target:" parameter to <code>X:\exepath\prgm.exe</code> and setting the "Start In" parameter to the user's path, <code>X:\exepath\users\username</code>.</p>
  
  <p>I currently launch the process like this:</p>
  
  <pre><code>Process p = new Process();
  p.StartInfo = new ProcessStartInfo( "X:\exepath\prgm.exe" );
  p.StartInfo.WorkingDirectory = "X:\exepath\users\username";
  p.Start();
  while (!p.HasExited) { }
  </code></pre>
  
  <p>However, when the process is started, the program it launches ends up looking for all resources in the <code>WorkingDirectory</code> instead of pulling user content from that folder and all other content from the directory the EXE resides in. <strike>This suggests that <code>Working Directory</code> and the system shortcut "Start In:" parameter behave differently.</strike></p>
  
  <p>Is there any way to mimic that behavior with a C# Process? Alternatively, is it possible to create a shortcut in C#, which I could then start with my Process invocation?</p>
  
  <p>Please let me know if more info would be helpful.</p>
  
  <p>EDIT - </p>
  
  <p>After some more trial and error, I decided to use <a href="http://www.geekpedia.com/tutorial125_Create-shortcuts-with-a-.NET-application.html" rel="nofollow">WSH to create a shortcut</a>  and run it. WSH uses the name WorkingDirectory for the value of the "Start In:" parameter. It behaves identically under the hood as the execution of the process in my code above. I am still getting the error.</p>