0

Is there any way to determine if a windows path is protected (i.e. if copying a file to it requires admins rights)? I was unable to a winapi function for this or an official list of windows protected paths.

So far, I know that C:, C:\Program Files and C:\Windows are protected and C:/Users/ is not, but I don't want to rely on trial by error.

Cœur
  • 37,241
  • 25
  • 195
  • 267
conectionist
  • 2,694
  • 6
  • 28
  • 50
  • I refer you to David Heffernan's [previous answer](http://stackoverflow.com/a/19995387/218597) to a similar question. As he mentions, Windows security is a complex beast (this is a _good thing_), so it is not simply a case of knowing if a path is "protected". – icabod Oct 28 '14 at 16:49
  • 1
    Yes. Try to write to the location, and handle the exception if it fails. – Ken White Oct 28 '14 at 16:56

0 Answers0