【发布时间】:2014-06-27 23:56:58
【问题描述】:
我需要从 Windows 商店应用程序运行命令?
命令是这样的:java -jar abc.jar
我该怎么做?
编辑:
我试过这个,但没有运气。它说找不到文件。
string exeFile = @"C:\DATA\start.bat";
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
}
}
【问题讨论】:
-
Windows 应用商店应用在沙盒中运行。我认为您将无法运行 java 命令
-
我不能执行包含这个命令的批处理文件吗?
标签: windows-store-apps windows-8.1