1

I'm a beginner in C# and I want to get all files and directory in Documents and Setting or Desktop folder etc.

I've been trying to disable my UAC on my computer but it doesn't work, I also tried to create a manifest in VS 2012 and change the "requestedExecutionLevel level" to administrator but with no success. I still get the "Access denied" error.

How can I get into these folders ? Am I doing something wrong ?

Patrick
  • 17,669
  • 6
  • 70
  • 85
  • There's no need to add tags to your title, there's a tag system for that. Please read http://meta.stackexchange.com/q/19190/147072 for more information. And greetings at the end of questions are not necessary, you can add that to your about page instead, linked via your character card at the bottom right of each question and answer you provide. That way future visitors will have an easier time reading the question without the clutter. – Patrick Apr 25 '13 at 14:53

1 Answers1

0

Your application needs admin level privledges. It's best to request them during start-up which can be done in the config file:

   <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> 
   <security> 
      <requestedPrivileges> 
         <requestedExecutionLevel 
            level="requireAdministrator" 
         /> 
      </requestedPrivileges> 
   </security> 
</trustInfo> 

Taken from: http://code.msdn.microsoft.com/windowsdesktop/CSUACSelfElevation-644673d3

Michael Cook
  • 1,676
  • 2
  • 26
  • 47
  • I already tried this, as I said before. But I tried to download the app from your link and it said I'm already running the program as admin. So why it doesn't work with my personnal app ? I have UAC disabled tho – user1451884 Apr 25 '13 at 16:38