Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to disable the usb drive on windows 7 machine.
I have used the following registry key ..

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR

key name: start and set the value to 4.


Its working for windows xp machine, and its not working for windwos 7 machine.

Wat might be the reason???. Any group policy will prevent this.

I have tired after restating the machine also.
Posted

In Windows Vista and later version of Windows , the concept of UAC added that prevents users to change the system settings.

Writing into HKLM requires Admin privilege. so you have to set the admin privilege in your code for running application in Admin privilege mode.
 
Share this answer
 
Comments
@BangIndia 8-Aug-13 6:16am    
i have set the value..
There is no prob in the setting.
Gautam Agrawal (Programming Expert) 8-Aug-13 6:22am    
If the value is set then there should be no problem in that. Additionally you can check
for the type of value . It should be REG_DWORD and once value is set then try to reconnect the device.
@BangIndia 8-Aug-13 6:29am    
I have tried
Gautam Agrawal (Programming Expert) 8-Aug-13 6:32am    
Is it 64 bit system ?
@BangIndia 8-Aug-13 6:36am    
Yes.
 
Share this answer
 
Comments
@BangIndia 7-Aug-13 9:44am    
This is what i have mentioned in the question itself.
Read my question properly
Sergey Alexandrovich Kryukov 7-Aug-13 9:48am    
I did not see this reference in your question. I can only see now that the registry key is the same as in one of the answers. Sorry if my answer is redundant.
—SA
@BangIndia 7-Aug-13 9:49am    
No Probs..

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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