title: C# - Running a new process as a user with blank password
body: <p>I have a child process I spawn from my main application that needs to be run as another local user on a Windows 7 machine.  I would prefer to not set a password on that user account, but it seems that creating a new process with impersonation does not allow for blank passwords or any type of null values.  Anyone know if this is possible?</p>
  
  <p>below was my attempt with passing a blank char:</p>
  
  <pre><code>ProcessStartInfo info = new ProcessStartInfo(@"C:\PathToExecutable");
  System.Security.SecureString psswd = new System.Security.SecureString();
  psswd.AppendChar('\0');
  psswd.MakeReadOnly();
  
  info.UseShellExecute = false;
  info.UserName = "NewProcessName";
  info.Password = psswd;
  info.Domain = "LocalMachine";
  
  Process newProc = new Process();
  newProc.StartInfo = info;
  
  newProc.Start();
  </code></pre>
  
  <p>edit:
  The error message I recieve</p>
  
  <p><code>Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced</code></p>