ProcessStartInfo.UseShellExecute プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ProcessStartInfo.UseShellExecute プロパティの意味・解説 

ProcessStartInfo.UseShellExecute プロパティ

プロセス起動オペレーティング システムシェル使用するかどうかを示す値を取得または設定します

名前空間: System.Diagnostics
アセンブリ: System (system.dll 内)
構文構文

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設定すると、入力出力エラーの各ストリームリダイレクトできます

メモメモ

   UserName プロパティnull 参照 (Visual Basic では Nothing) や空の文字列ない場合、または Process.Start(ProcessStartInfo) メソッド呼び出したときに InvalidOperationException がスローされる場合UseShellExecutefalse設定する必要があります

オペレーティング システムシェル使用してプロセス起動すると、Process コンポーネント使用して任意のドキュメント (任意の登録済みファイル タイプ既定の "open" アクション実行できるように関連付けられています。) を起動し印刷などのファイル対す操作実行できますUseShellExecutefalse場合は、Process コンポーネント使用して実行可能ファイル起動だけ実行できます

メモメモ

ErrorDialog プロパティtrue設定するには、UseShellExecutetrue にする必要があります

WorkingDirectory プロパティ動作は、UseShellExecutetrue場合UseShellExecutefalse場合とで異なりますUseShellExecutetrue場合は、WorkingDirectory プロパティ実行可能ファイルの場所を指定しますWorkingDirectory空の文字列場合は、現在のディレクトリ実行可能ファイル格納されていると解釈されます。

UseShellExecutefalse場合は、実行可能ファイル検索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();
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ProcessStartInfo クラス
ProcessStartInfo メンバ
System.Diagnostics 名前空間
ProcessStartInfo.RedirectStandardInput プロパティ
ProcessStartInfo.RedirectStandardOutput プロパティ
ProcessStartInfo.RedirectStandardError プロパティ



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ProcessStartInfo.UseShellExecute プロパティ」の関連用語

ProcessStartInfo.UseShellExecute プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ProcessStartInfo.UseShellExecute プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS