Subscribe to How-To Geek

Registry Hack to Disable Writing to USB Drives

A common security concern at organizations is allowing users to plug in a usb flash drive, because they could so easily copy corporate data.

Since Windows XP SP2, you can disable writing to USB devices altogether using a simple registry hack. Here it is:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies]
“WriteProtect”=dword:00000001

You can also just download one of the following registry tweaks to enable or disable writing to USB drives.

Enable USB Write

Disable USB Write

Once you use the registry hack, you will have to reboot for the changes to take effect. One should also note that if you are using this trick, you should make sure that the users are not administrators on the computer, because they could easily change this setting back.

This works on Windows Vista as well. Here’s the window you’ll get when you try and write to a USB drive:

| More
This article was originally written on 03/9/07 Tagged with: Security, Windows Vista

Daily Email Updates

You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:

Comments (35)

  1. Terinea Tech Tips

    Nice Tip!

    Great looking web site, I’ll be back soon!

    Jamie

  2. C.X.

    How do you prevent employees from copying corporate data to a remote website where they can download it at their leisure?

  3. The Geek

    @C.X.

    Typically in an environment that is locked down, you’d have logging on the firewall of all traffic, and probably the majority of outgoing ports would be blocked.

    Firewall is the only way to prevent something like that.

  4. G Christie

    This is a great tip, but would this also prevent access to other usb devices like mice, keyboards and cameras?

  5. Ulldolf

    but what can i do, if the registry is write protected for me? I searched the web from east to west and from south to north ;o)
    but i can’t find a tip how to change the registry without rights.

  6. The Geek

    You have to be an administrator on the machine in order to make registry changes.

  7. Dave

    Elevation of privileges would be the only way for a (limited) user to make changes to the registry. Without using an exploit / malware, you’re pretty well done. Won’t post one here as my SysAdmin hat is on, but I’m sure if you were willing to lose your job, you could try it anyway…

  8. Loi

    i can’t find StoragDevicePolicies in the registry. How can I change the value?

  9. Dan

    Im the same as Loi, i dont have this item (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies) when i traverse regedit, therefore im not sure adding it in will make any difference… would i not expect to be seeing this item already?

  10. Nages

    Hi Guys,

    We want to disable write option in CDROM Drive. Which mean the users can copy data from CD to Harddsik and and prevent copy data from harddisk to CD. how to do this in GPO. (win2003 Server)

    Thanks,

  11. JoeG

    To prevent users from copying data to another site, use a filtering proxy (like Dans Guardian), in concert with the firewall to keep unneeded ports closed (IPCOP is a good one).

    This solution has been working great for me for years.

    You can also prevent USB writing with GPO as noted here: http://www.petri.co.il/disable.....th_gpo.htm

    Preventing CDROM write access can be done a couple ways, as noted here: http://groups.google.com/group.....e?lnk=raot

    And without privilege elevation, there is no way for a non administrative user to write to the registry. There are several methods to gain this ability from a standard user account, however I would strongly suggest that you not attempt it, as if you don’t already know how to do it, and your IT department is anything like mine, they WILL know, and you very likely WILL be fired. Even if you manage to get away with it initially, they WILL find out eventually.

  12. ramon

    how would you do the same thing in a windows 2000 enviroment.

  13. vishal

    i cant find the ‘StorageDevicePolicies’ ???????//

    what should i do????????

  14. Wakasyaka Emmanuel

    the registry disabling of the usb is the best thing that ever happened to me. i have a communial laptop and telling one not to pop in their flash is telling them to actually do so, i have a project to work on and they will see it but never copy the damn thing. thanks so much i will always be around.
    Wakas.

  15. janedoe

    would this hack disable usb for all users even for the administrator?

  16. janedoe

    is there a hack to disable usb read-write for normal users only? i mean a hack that would require administrative rights to enable usb read-write?

    thanks in advance

  17. Ulldolf

    @DAVE: Of Course, we will all lose our jobs, if we try to write the registry without an admin account. Maybe we will be arrested, too. And then the lethal injection will come and we all have to die ;o)

  18. Nagendra

    OK it’s great tip. But I am a traveling from system to system only for using my Pen Drive data. It is not possible to change every system registry. Is there any software, which act as “Write Protect Notch” in floppy drive.

  19. Wakasyaka Emmanuel

    hi guyz.
    thought bout this already?
    with the many people having usb sticks for carrying all their data, i think its important for us to try protecting that data. this is how we do it. we creat a small program that locks the registry and hence the modification of the flash content when i insert the flash and will run in that mode so that i can invoke it while still running to enable writing of specified files then close again. its better than an anti virus coz then the viruses will remain in the host computer wishing they could do something. get your mind working we need to render this viruses jobless. or what is your thought is my approach good enough to handle what i imagine? if not feel free to give me a way to go bout it. Geeks for life

  20. Arviragus

    A pointless exercise. An organization can lock down a system as much as they want, but as soon as they provide a cell phone that can use a memory card (i.e. Blackberry), or provide’s an employee with a laptop, you can just wave as your data walks out your door. As the adage goes, “if you make ‘XYZ’ illigal, only criminals will do ‘XYZ’.”

  21. john

    jus out of curiosity i wus lke to know if a cell phone that can use a memory card like nokia n72 will do the same???

  22. barbara ann

    can someone tell me how to get my system sound and all sound back on my computer after installing MagicJack a usb device??

  23. Massive Attack

    Nice work

  24. Abhi

    How do I enable the disabled USB for pendrive in windows vista?

  25. Waqas bhatti

    i hv just downloaded the disable write protection file.lets see its works or not
    i’ll tell u soon whn i’ll reboot it once
    thnx 4 the help in advance coz i suppose it will work
    Take care

  26. justin

    Works like a charm even on vista, was wondering is it possible to only block write access on specific usb devices using device hardware ids ???

  27. CO

    Thank you! Suddenly, my usb camera drive wouldn’t let me make changes or delete photos. I’m the only one who uses the drive and the only one with access, so I had no idea what went wrong. It’s been annoying the heck out of me for weeks and using your information, it’s fixed!

  28. Bobby

    I tried this fix for the same problem I am having with my SD Card. It still says that it is write protected. Is there a different fix for an SD Card? I am running Vista with SP1.

  29. Harun Rasheed

    I tried and its working fine. but its block the usb data card access also. did u have any policy to work with USB datacard simultaneously by using usb port

  30. JCates

    First of all, I would like to say this is a great site and thank you for everything you do to help the IT community.

    Secondly, the information and registry script (as well as the user comment on CD R/W) has been very useful. Especially with HIPPA rules and regulations in the medical field..

    Thank You Again.

  31. shan killer

    tKKKzzz <3 (:

  32. chiqman

    i try so many more ,it dost work. from 1 unit my usb write protect . now become 4 of my usb become write protect … mati wo what should i do . the registry make my problemn become worst please help me ..

  33. ixion

    how is it possible to block IRC? (i know irrelevant to this post) i want to unblock it…

  34. Sunil

    How do I enable the disabled file copy in USB for pendrive in windows2000?

  35. sunny

    Hi,
    My USB actually became write protected accidently. I don’t know how but i suspect it was because i shut down the computer before safely removing the USB drive. I used the software given on this page but it doesnt appear to work. Is there a registry hack to enable writing on a USB for windows vista? the one on this page is for disabling

    THanks


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Our Friends
Getting Started


About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
mDNSResponder.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.