title: Win32Exception: The directory name is invalid
body: <p>I'm trying to run a process as a different user that has Administrator privilege in 2 different computers running Vista and their UAC enabled but in one of them I get a Win32Exception that says "The directory name is invalid"</p>
  
  <p>Can anyone tell me what is wrong with my code?</p>
  
  <pre><code>var myFile = "D:\\SomeFolder\\MyExecutable.exe";
  var workingFolder = "D:\\SomeFolder";
  var pInfo = new System.Diagnostics.ProcessStartInfo();
  pInfo.FileName = myFile;
  pInfo.WorkingDirectory = workingFolder;
  pInfo.Arguments = myArgs;
  pInfo.LoadUserProfile = true;
  pInfo.UseShellExecute = false;
  pInfo.UserName = {UserAccount};
  pInfo.Password = {SecureStringPassword};
  pInfo.Domain = ".";
  
  System.Diagnostics.Process.Start(pInfo);
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The application that executes the above code has requireAdministrator execution level.
  I even set the working folder to <strong>"Path.GetDirectoryName(myFile)"</strong> and <strong>"New System.IO.FileInfo(myFile).DirectoryName"</strong></p>