System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized; startInfo.FileName = "cmd.exe"; startInfo.Arguments = "chkdsk"; process.StartInfo = startInfo; process.Start();
ProcessStartInfo procStartInfo = new ProcessStartInfo("CMD.EXE", "defrag"); procStartInfo.WindowStyle = ProcessWindowStyle.Maximized; procStartInfo.RedirectStandardOutput = true; procStartInfo.UseShellExecute = false; procStartInfo.CreateNoWindow = true; Process pro = new Process(); pro.StartInfo = procStartInfo; pro.Start(); // string result = pro.StandardOutput.ReadToEnd(); // pro.WaitForExit();
REM Open a new explorer window cmd.exe /C explorer.exe
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)