无法在Windows 10周年更新中启动带有Process的Windows应用程序

时间:2016-08-19 22:35:03

标签: c# process windows-10 launch

我正在尝试为Windows Apps制作一个简单的启动器。专门用于邮件应用程序

public static void Main()
{
        Process proc = new Process();
        proc.StartInfo.FileName = "explorer.exe";
        proc.StartInfo.Arguments = @"shell:Appsfolder\microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.mail";
        proc.Start();

        // Short code
        //Process.Start("explorer", @"shell:Appsfolder\microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.mail");
}

安装周年更新后,此代码对我不起作用。 它正在使用以前版本的Windows。 有人可以测试一下吗? 我需要添加一些东西吗?

如果我通过Run运行此命令,它仍在工作。

2 个答案:

答案 0 :(得分:0)

我已在我身边测试过,它实际上没有打开电子邮件,只是打开我的文档文件夹。 但我认为你不需要使用如此复杂的代码来启动Mail应用程序。 只需使用以下代码(由Uri ms-unistore-email启动邮件):

Process proc = new Process();
proc.StartInfo.FileName = "explorer.exe";
proc.StartInfo.Arguments = "ms-unistore-email://";   
proc.Start(); 

使用Uri启动应用程序在代码中很受欢迎。您可以参考以下链接:How can I launch the Alarms App through a Universal Windows App

答案 1 :(得分:0)

首先,我想验证Windows 10周年纪念日的变化,这使得启动Windows应用程序变得更加棘手。我遇到了和你一样的问题(我使用的是java而不是C#)。 我已取代

  

" explorer shell:AppsFolder \ Microsoft.WindowsCamera_8wekyb3d8bbwe!App"

  

" explorer microsoft.windows.camera:"

使它工作(在这种情况下是相机)。 请注意,这两个命令在从Windows直接执行时起作用,但只有第二个命令在从第三方程序启动时起作用。

相关问题