title: Hide window on process.start with user and password
body: <p>I have the following code inserted in a console application:</p>
  
  <pre><code>Process delete = new Process();
  startInfo.FileName = "schtasks.exe";
  startInfo.WorkingDirectory = @"C:\Windows\System32\";
  startInfo.UserName = @"AdminUser";
  startInfo.Domain = @"mydomain";
  startInfo.Password = encryptedPassword;
  startInfo.CreateNoWindow = true;
  startInfo.UseShellExecute = false;
  startInfo.RedirectStandardOutput = true;
  startInfo.Arguments = @" /delete /s 192.168.1.5 /tn Task1 /F";
  delete.StartInfo = startInfo;
  delete.Start();
  delete.WaitForExit();
  delete.Close();
  </code></pre>
  
  <p>This code runs fine, but a new window is launched. I understand that it happens because I run the process with explicit username and password but I really need this and I also need to hide the window, is there a possibility to do that?
  As an alternative, I need to execute "schtasks" as an administrator of the remote machine without using the parameters /U and /P of schtasks because I need to encrypt them, so afaik the only possibility is to use Securestring (as I do in my code).
  Can you help me?</p>