ProcessLauncher.RunToCompletionAsync メソッド

定義

オーバーロード

RunToCompletionAsync(String, String)

新しいプロセスを起動します。 この非同期関数は、起動されたプロセスが終了すると完了します。

RunToCompletionAsync(String, String, ProcessLauncherOptions)

指定したオプションを含む新しいプロセスを起動します。 この非同期関数は、起動されたプロセスが終了すると完了します。

RunToCompletionAsync(String, String)

新しいプロセスを起動します。 この非同期関数は、起動されたプロセスが終了すると完了します。

public:
 static IAsyncOperation<ProcessLauncherResult ^> ^ RunToCompletionAsync(Platform::String ^ fileName, Platform::String ^ args);
/// [Windows.Foundation.Metadata.Overload("RunToCompletionAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<ProcessLauncherResult> RunToCompletionAsync(winrt::hstring const& fileName, winrt::hstring const& args);
[Windows.Foundation.Metadata.Overload("RunToCompletionAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<ProcessLauncherResult> RunToCompletionAsync(string fileName, string args);
function runToCompletionAsync(fileName, args)
Public Shared Function RunToCompletionAsync (fileName As String, args As String) As IAsyncOperation(Of ProcessLauncherResult)

パラメーター

fileName
String

Platform::String

winrt::hstring

起動するプロセスの名前。

args
String

Platform::String

winrt::hstring

プロセスを実行するための引数。

戻り値

非同期操作が完了すると、起動されたプロセスからの終了コードが含まれます。

属性

Windows の要件

アプリの機能
systemManagement

注釈

この API では、IoT systemManagement 機能を使用し、IgnorableNamespaces リストに iot を含める必要があります。 ユーザーは、Package.appmanifest: <iot:Capability Name="systemManagement"/>に次のコードを追加し、既存の IgnorableNamespacesの一覧 iot を追加できます。

プロセスを起動するには、.exe を .appx パッケージに含めるか、この API の許可リストに登録する必要があります。 許可リストに .exe を追加するには、HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EmbeddedMode\ProcessLauncher:AllowedExecutableFilesList 変更し、実行可能ファイルをREG_MULTI_SZ書式設定された文字列に追加します。

例えば:

reg ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EmbeddedMode\ProcessLauncher" /f /v AllowedExecutableFilesList /t REG_MULTI_SZ /d "c:\windows\system32\cmd.exe\0"

こちらもご覧ください

適用対象

RunToCompletionAsync(String, String, ProcessLauncherOptions)

指定したオプションを含む新しいプロセスを起動します。 この非同期関数は、起動されたプロセスが終了すると完了します。

public:
 static IAsyncOperation<ProcessLauncherResult ^> ^ RunToCompletionAsync(Platform::String ^ fileName, Platform::String ^ args, ProcessLauncherOptions ^ options);
/// [Windows.Foundation.Metadata.Overload("RunToCompletionAsyncWithOptions")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<ProcessLauncherResult> RunToCompletionAsync(winrt::hstring const& fileName, winrt::hstring const& args, ProcessLauncherOptions const& options);
[Windows.Foundation.Metadata.Overload("RunToCompletionAsyncWithOptions")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<ProcessLauncherResult> RunToCompletionAsync(string fileName, string args, ProcessLauncherOptions options);
function runToCompletionAsync(fileName, args, options)
Public Shared Function RunToCompletionAsync (fileName As String, args As String, options As ProcessLauncherOptions) As IAsyncOperation(Of ProcessLauncherResult)

パラメーター

fileName
String

Platform::String

winrt::hstring

開始するプロセスのファイル名。

args
String

Platform::String

winrt::hstring

指定したプロセスの引数。

options
ProcessLauncherOptions

プロセスを実行するための関連オプション。

戻り値

非同期操作が完了すると、起動されたプロセスからの終了コードが含まれます。

属性

Windows の要件

アプリの機能
systemManagement

注釈

この API では、IoT systemManagement 機能を使用し、IgnorableNamespaces リストに iot を含める必要があります。 ユーザーは、Package.appmanifest: <iot:Capability Name="systemManagement"/>に次のコードを追加し、既存の IgnorableNamespacesの一覧 iot を追加できます。

プロセスを起動するには、.exe を .appx パッケージに含めるか、この API の許可リストに登録する必要があります。 許可リストに .exe を追加するには、HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EmbeddedMode\ProcessLauncher:AllowedExecutableFilesList 変更し、実行可能ファイルをREG_MULTI_SZ書式設定された文字列に追加します。

例えば:

reg ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EmbeddedMode\ProcessLauncher" /f /v AllowedExecutableFilesList /t REG_MULTI_SZ /d "c:\windows\system32\cmd.exe\0"

こちらもご覧ください

適用対象