프로세스를 시작할 때 운영 체제 셸을 사용할 것인지 여부를 나타내는 값을 가져오거나 설정합니다.
네임스페이스: System.Diagnostics
어셈블리: System(system.dll)
Public Property UseShellExecute As Boolean
Dim instance As ProcessStartInfo
Dim value As Boolean
value = instance.UseShellExecute
instance.UseShellExecute = value
public bool UseShellExecute { get; set; }
public:
property bool UseShellExecute {
bool get ();
void set (bool value);
}
/** @property */
public boolean get_UseShellExecute ()
/** @property */
public void set_UseShellExecute (boolean value)
public function get UseShellExecute () : boolean
public function set UseShellExecute (value : boolean)
속성 값
프로세스를 시작할 때 셸을 사용하려면 true이고, 그렇지 않으면 프로세스가 실행 파일에서 직접 만들어집니다. 기본값은 true입니다.
이 속성을 false로 설정하면 입력, 출력 및 오류 스트림을 리디렉션할 수 있습니다.
운영 체제 셸을 사용하여 프로세스를 시작하면 Process 구성 요소를 사용하여 문서(기본 열린 작업이 있는 실행 파일과 관련된 등록 파일 형식인)를 시작할 수 있으며 인쇄와 같은 파일 작업을 수행할 수 있습니다. UseShellExecute가 false이면 Process 구성 요소를 사용하여 실행 파일만 시작할 수 있습니다.
참고 |
|---|
| ErrorDialog 속성을 true로 설정할 경우 UseShellExecute가 반드시 true여야 합니다. |
WorkingDirectory 속성은 UseShellExecute가 false일 때보다 UseShellExecute가 true 일 때 다르게 동작합니다. UseShellExecute가 true이면 WorkingDirectory 속성은 실행 파일의 위치를 지정합니다. WorkingDirectory가 빈 문자열이면 현재 디렉터리는 해당 실행 파일을 포함하는 것으로 간주됩니다.
UseShellExecute가 false이면 WorkingDirectory 속성은 해당 실행 파일을 찾는 데 사용되지 않습니다. 대신 실행되는 프로세스에서 사용되며 새 프로세스의 컨텍스트 내에서만 의미를 갖습니다.
compiler.StartInfo.FileName = "csc.exe"
compiler.StartInfo.Arguments = "/r:System.dll /out:sample.exe stdstr.cs"
compiler.StartInfo.UseShellExecute = False
compiler.StartInfo.RedirectStandardOutput = True
compiler.Start()
Console.WriteLine(compiler.StandardOutput.ReadToEnd())
compiler.WaitForExit()
Process compiler = new Process();
compiler.StartInfo.FileName = "csc.exe";
compiler.StartInfo.Arguments = "/r:System.dll /out:sample.exe stdstr.cs";
compiler.StartInfo.UseShellExecute = false;
compiler.StartInfo.RedirectStandardOutput = true;
compiler.Start();
Console.WriteLine(compiler.StandardOutput.ReadToEnd());
compiler.WaitForExit();
Process^ compiler = gcnew Process;
compiler->StartInfo->FileName = "cl.exe";
compiler->StartInfo->Arguments = "/clr stdstr.cpp /link /out:sample.exe";
compiler->StartInfo->UseShellExecute = false;
compiler->StartInfo->RedirectStandardOutput = true;
compiler->Start();
Console::WriteLine( compiler->StandardOutput->ReadToEnd() );
compiler->WaitForExit();
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.
.NET Framework
2.0, 1.1, 1.0에서 지원
.NET Compact Framework
2.0에서 지원