Starting a native WindowsApp returns denied access

0

I'd like to start the ScreenSketch.exe windows app via Shell, but the directory is denied:

    var allFiles = System.IO.Directory.GetFiles(@"C:\Program Files\WindowsApps", "ScreenSketch.exe", 
    System.IO.SearchOption.AllDirectories);
    // Directory WindowsApps is denied
    if (allFiles.Length > 0)
    {
       allFiles[0].ShellOpen(); // ShellOpen is an extension method
    }

Message:

HResult=0x80070005 Message=Access to the path 'C:\Program Files\WindowsApps' is denied.

c#
.net
windows
asked on Stack Overflow Nov 19, 2019 by jssmttibr • edited Nov 19, 2019 by Symon

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0