Robocopy を使用して、あるコンピューターから別のコンピューターにファイルを移動します。以下のコードを使用しています。
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);
}
}
タスク マネージャーを見ると、多くの「コンソール ウィンドウ ホスト」および「Microsoft Robocopy」プロセスが表示されます。以下のスクリーンショットから状況を確認できます。
どうすればこの問題を解決できますか?