1

enter image description hereI'm working on a software that takes care of extracting information about the USB devices that have been connected to the PC and to do this I'm using the system registry. I would also like to try to retrieve information regarding the last plugged/unpluggedand datetime for that devices. To do this you need to access the "Properties" subkeys (see attached image).

The problem is that to access it, administrator privileges are not enough and I could only do it by logging in as SYSTEM otherwise I get an access denied error. How could I do this thing through c# ? Are there other avenues I could follow? Or is there a way to make the application run with even higher privileges than admin?

  • You can just right-click on the executable and select "Run as administrator". You can also [tell Windows to always run it as administrator](https://stackoverflow.com/questions/2818179/how-do-i-force-my-net-application-to-run-as-administrator). Does this answer your question? – David Grayson Nov 28 '22 at 18:27
  • No. An Administrator account has not enought privileges. For example: under "Properties" key there are othere subkeys that Administrator account can't see but only SYSTEM account can. – Antonio Argentieri Nov 29 '22 at 08:35

0 Answers0