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.

Jaskier
  • 1,075
  • 1
  • 10
  • 33
jssmttibr
  • 9
  • 1
  • I believe it's because you're trying to `Get` the file. Take a look at this: https://stackoverflow.com/questions/811521/how-do-i-open-a-file-using-the-shells-default-handler . – Jaskier Nov 19 '19 at 15:27
  • @"C:\Program Files\WindowsApps" has access denied, because of whit it not list the directory. – jssmttibr Nov 19 '19 at 19:27

0 Answers0