0

非表示のウィンドウからプロセスを実行しようとすると、奇妙な問題に直面しました。実行するプロセスは、プロセスのように非表示で実行されます。何か問題がありますか? その子プロセスを非表示にせずに実行したい。

Process.Start(Path.GetTempPath() + "cleanup.exe", Path.GetDirectoryName(Application.StartupPath);
4

1 に答える 1

0

Process以下のようにクラスのオブジェクトを作成してみることができます:

Process objProcess = new Process();            
objProcess.StartInfo.UseShellExecute = false;
objProcess.StartInfo.RedirectStandardOutput = true;
objProcess.StartInfo.CreateNoWindow = true;
objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

// Passing the batch file/exe name
objProcess.StartInfo.FileName = string.Format(strBatchFileName);

// Passing the argument
objProcess.StartInfo.Arguments = string.Format(strArgument);
try
{
 objProcess.Start();
}
catch
{
 throw new Exception("Batch file is not found for processing");
}
于 2013-04-01T14:07:31.423 に答える