コメントの私のリンクからコピーされました:
// Path to the file in the app package to launch
string exeFile = @"C:\Program Files (x86)\Steam\steamapps\common\Skyrim\TESV.exe";
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(exeFile);
if (file != null)
{
// Set the option to show the picker
var options = new Windows.System.LauncherOptions();
options.DisplayApplicationPicker = true;
// Launch the retrieved file
bool success = await Windows.System.Launcher.LaunchFileAsync(file, options);
if (success)
{
// File launched
}
else
{
// File launch failed
}
}
var options = **
もちろん、ApplicationPickerが開かないように、-Partを省略できます。
またはこれを使用できます:
StorageFile fileToLaunch = StorageFile.GetFileFromPathAsync(myFilePath);
await Windows.System.Launcher.LaunchFileAsync(fileToLaunch);