title: Process (robocopy) not closing
body: <p>I use Robocopy to move files from one computer to another. I am using the code below:</p>
  
  <pre><code>    public void MoveRecords()
      {
          try
          {
              using (Process Robocopy = new Process())
              {
                  Robocopy.StartInfo.FileName = this._commandPromptCommand;
                  Robocopy.StartInfo.Arguments = this._commandPromptString;
                  Robocopy.StartInfo.UseShellExecute = false;
                  Robocopy.StartInfo.CreateNoWindow = true;
                  Robocopy.Start();
  
                  DateTime StartTime = DateTime.Now;
  
                  if (Robocopy.WaitForExit(AppSettings.MaxMoveOperationWaitTime))
                  {
                      TimeSpan ElapsedTime = DateTime.Now - StartTime;
                      this._logRobocopyExitCode(Robocopy.ExitCode, ElapsedTime);
                  }
                  else
                  {
                      Logger.Write(string.Format("Timeout occured for the move operation of {0} from {1}. ", _getFilesInProgress(), this._ip), EventLogEntryType.Error);
                      Robocopy.Kill();
                  }
              }
          }
          catch (Exception ex)
          {
              Logger.Write(ex, EventLogEntryType.Error);
          }
      }
  </code></pre>
  
  <p>When i look at to task manager i saw many "Console Window Host" and "Microsoft Robocopy" processes. You can see the situation from the screenshot below.</p>
  
  <p><img src="https://i.stack.imgur.com/YBP8T.png" alt="enter image description here"></p>
  
  <p>How can i solve this problem?</p>