728x90
반응형
728x170
using System.Diagnostics;
string targetDirectoryPath = "d:\\temp";
string dosCommand = string.Format("RMDIR /S /Q \"{0}\"", targetDirectoryPath);
Process process = new Process();
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = string.Format("/C {0}", dosCommand);
process.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.Start();
process.WaitForExit();
728x90
반응형
그리드형(광고전용)
'C# > Common' 카테고리의 다른 글
[C#/COMMON] 스레드 안전 큐 사용하기 (0) | 2018.11.29 |
---|---|
[C#/COMMON] 스케줄 서버에서 스케줄 실행 대상 구하기 (0) | 2018.11.24 |
[C#/COMMON] FileSystemWatcher 클래스 : 이벤트 중복 방지하기 (0) | 2018.11.23 |
[C#/COMMON] FileSystemWatcher 클래스 사용하기 (0) | 2018.11.23 |
[C#/COMMON] 윈도우즈 서비스에서 윈도우즈 서비스 실행하기 (인자 전달 포함) (0) | 2018.11.02 |
[C#/COMMON] WIN32 API를 사용해 디렉토리 크기 구하기 (0) | 2018.10.02 |
[C#/COMMON] DirectoryInfo 클래스 : GetDirectories 메소드를 사용해 디렉토리 크기 구하기 (0) | 2018.10.01 |
[C#/COMMON] WebClient 클래스 : HTTPS 파일 다운로드 하기 (0) | 2018.09.22 |
[C#/COMMON] DirectoryInfo 클래스 : EnumerateDirectories 메소드를 사용해 디렉토리 크기 구하기 (0) | 2018.09.21 |
[C#/COMMON] 파일 경로 축약하기 (0) | 2018.09.17 |
댓글을 달아 주세요