Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to delete the USB storage device information in windows 7, and now I know it is releate with these keys under HKEY_LOCAL_MACHINE\SYSTEM\CURRENT_CONTROL_SET\ENUM\USBS ,but i cannot delete it succefully because of the access control.Does anyone know how to solve this problem,think you
Posted
Updated 21-Apr-13 21:08pm
v2
Comments
Sergey Alexandrovich Kryukov 22-Apr-13 2:56am    
There is no such thing as "regedit key"... :-)
—SA
Jochen Arndt 22-Apr-13 2:57am    
See this link if you want to remove drivers of old USB devices: http://www.faqforge.com/windows/uninstall-usb-drivers-on-windows-7/. By uninstalling the driver, all related information is also removed from the registry.

1 solution

You just don't have enough permission. It also depends on Windows version. On Windows 7 and later (Vista, too, but did it ever existed? :-)) with its UAC, it's not enough to be logged on as administrator, you still have to run the application under elevated privileges. Please see:
http://4sysops.com/archives/vista%E2%80%99s-uac-8-ways-how-to-elevate-an-application-to-run-it-with-administrator-rights/[^],
http://www.sevenforums.com/tutorials/11841-run-administrator.html[^].

You can avoid exception in all cases, if you request elevated privileges from the very beginning, when you start the application in any way. You can embed appropriate application manifest with this option. Please see:
http://msdn.microsoft.com/en-us/library/bb756929.aspx[^].

Note that you cannot avoid UAC dialog requesting for user confirmation, which would defeat the purpose of UAC. You can only switch off confirmation for the system globally, which I would not recommend.

See also: http://en.wikipedia.org/wiki/User_Account_Control[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900