How to Write-Protect Your USB Flash Drive

USB Write ProtectMany a time, it becomes necessary for us to write protect our USB flash drive so as to protect it from viruses and other malware programs. As flash drives are so popular and most widely used to move data between computers, they are the prime target for attackers as a means to get infections spread around the computer world. Also, since USB drive is not a Read-Only Memory (ROM), the data inside it can easily be modified or deleted by malware programs.

But unfortunately, most of the new flash drives do not come with a write-protect feature as the manufacturers wish to cut down the cost of production. Hence, the only way to write-protect your USB flash drives is to enable this feature on your own computer.

Steps to Write-Protect Your USB Drive:

This can be done by adding a small entry to the Windows registry which acts as a switch that can be enabled to make use of the write protection or disabled to allow write access. Here we go:

  1. Open the Registry Editor (Open the “Run” dialog box, type regedit and hit “Enter”).

  2. Navigate to the following Registry key:

  3. Create a New Key named as StorageDevicePolicies. To do this, right-click on Control, again click on New -> Key and name it as StorageDevicePolicies.

  4. Now right-click on  StorageDevicePolicies and create a New -> DWORD (32-bit) Value and name it as WriteProtect.

    Write-Protect USB Drive

  5. Double-click on WriteProtect and set the Value data to 1.

    Now the right-protection for USB drives is enabled on your computer (no restart required) and thus it would not be possible for anyone or any program to add/delete the contents from your USB flash drive. Any attempt to copy or download the files onto the USB drive will result in the following error message being displayed.

    USB-Write Protect Error

To revert and remove the write-protection, all you need to do is just change the Value data for WriteProtect (Step-5) from 1 back to 0. Now write access to all the USB devices is re-enabled.

Sometimes it may seem difficult to remember and follow the above mentioned steps each time you want to enable/disable the write protection. Hence as an alternative way, there are many tools available to automatically enable/disable the write-protection feature. One of my favorite tool is USB Write Protect by Naresh Manadhar.

Using this tool, you can limit write access to your USB drives with just a click of a button. You can download this tool from the following link:

I hope you’ve now understood how to enable or disable write-protection of USB devices on your computer.


  1. Ankit Das
    February 24, 2011 at 2:04 PM

    The software is not working on Windows 7 (SP1)..

    • Srikanth
      February 24, 2011 at 2:23 PM

      @ Ankit Das

      You need to run the application as an administrator (Right-click on the software and select “Run as administrator”). Only then it should be able to enable/disable the write-protect feature.

    • vikesh
      October 10, 2012 at 2:22 AM

      please help
      dear shrkant follow you step Run command “How to Install Windows 7 From a USB Drive” and my pen drive or corrupted sow… or not formatted pen drive… show please help me
      how to formatted pen drive

  2. Om Kumar
    February 24, 2011 at 3:07 PM

    Yes it’s good but how to learn such things. Mainly focus on about registry and how to clean that and what’s the other use of that and how to that what to edit in registry.

  3. shan
    February 25, 2011 at 4:56 PM

    hi am a bca student and u r the best, i want to desable my task mngr, my document and control pannel and command promt plz guide my self

  4. Sumeet Kukreja
    February 26, 2011 at 12:27 AM

    Cool, But This will only be in my comnputer? When i plug USB in another computer so he can easily Modify/delete my data. Right?

    • Srikanth
      February 26, 2011 at 8:45 AM

      @ Sumeet Kukreja

      Yes! It works only on your computer. For other computers, you need to first enable the write protection before inserting the USB drive.

  5. Gaurav Garg
    February 26, 2011 at 8:11 AM

    Nice Post

    I like All The Content Available here..

    please tell some trick to protect hard disk and pen drive…

    I am Gaurav Garg From

    Thanks If You Post Related To HDD Safty

  6. Om Kumar
    February 26, 2011 at 11:50 AM

    Yes it’s good but how to learn such things. Mainly focus on about registry and how to clean that and what’s the other use of that and how to know for different different things that what to edit in registry.

    February 26, 2011 at 2:06 PM

    Nice registry hack

  8. sam
    March 3, 2011 at 11:13 AM

    awesome !!
    which college are you from , and from where did you get these info …
    and how do understand every term of os.
    m a noob , want 2 be pro.
    well thanx really appreciated … : )

  9. madhu prasad
    March 4, 2011 at 9:05 PM

    It is working.
    Thank you.

  10. sam
    March 5, 2011 at 3:41 PM

    thanx …: )
    dude r u ethical hacker or something ???
    u r like “indian adrino lamo” ,,./../
    well keep up the good work … !!!

  11. Hack Primium Account
    March 13, 2011 at 8:04 AM

    Fantastic Tutorial Dude !!

  12. rajkumar
    March 18, 2011 at 6:41 PM

    hello shrikanth
    this is a good one post

  13. Deep
    March 19, 2011 at 6:17 PM

    Nice trick sir……….

  14. Rishi
    March 21, 2011 at 6:11 PM

    Great !!!! it Really works

  15. @Nasim
    March 21, 2011 at 10:03 PM

    It really works
    u need to remove the usb after assigning The Value

  16. abhishank
    March 23, 2011 at 10:26 PM

    nice tutorial..

  17. Ramraj
    March 26, 2011 at 12:04 PM

    nice work…it realy works

  18. Vamsi @ HoverPcHacks
    March 27, 2011 at 5:27 PM

    Nice trick with registry!!! But beginners should be careful while editing registry values. Anyway thanks for sharing this nice tip.

  19. AllCelebrityBlogs
    April 1, 2011 at 7:25 PM


    Nice one, Thanx for sharing. However, I have heard now a days usb flash drives are coming with some hardware lock as well. Is that true?

  20. Jamie
    April 6, 2011 at 1:56 AM

    Hey really informative post.
    during net surfing i found
    this website useful.
    and looking for further new posts :)

  21. Tharun |
    April 15, 2011 at 9:55 AM

    Really useful..thanks a lot…Like all the tricks on this site..

  22. Zeeshan
    April 22, 2011 at 12:02 AM

    Hello, this protection is getting reflected on my computer only. If we want to secure our USB flash drive from reading and writing to other system then wats the procedure??

    • Srikanth
      April 22, 2011 at 1:52 PM

      @ Zeeshan

      I will come up with a new post on your query…

    • shiv
      January 8, 2013 at 4:38 PM

      i want people to see the data/video audio in the thumb drive, but they should not copy that to other System/devices. how can i do this ?

  23. Adrien DAVIN
    April 29, 2011 at 4:54 PM

    My website is in french. Gohacking is a superb website!!!!!

  24. sri
    May 2, 2011 at 7:30 AM

    how to make a cd/dvd uncopyable plzz reply me

  25. Abdi fatah farah Ali
    May 20, 2011 at 12:56 PM

    ok.nice work…it realy works

  26. siva_phd9
    May 30, 2011 at 3:26 PM

    A very useful article.Thanks for sharing

  27. Rk
    June 1, 2011 at 8:15 PM

    after doing above steps will it possible for a virus to enter my PC’s Hard Disk
    after opening USB drive

  28. Aniket
    July 6, 2011 at 12:19 AM

    Thi i really great thing. Thank a lot 4 thi tech. If u have more idea of virsu so,pl. tell m……. Thanx…….

  29. Sarvesh
    July 11, 2011 at 12:33 AM

    Hello Sir,

    I’m reading your posts since 3 (or more years , don’t remember exactly) years. You are an inspiration for me. I started learning Programming languages after completing my 12th two years back.
    Right now, I have created hundreds of .Net Applications and games editing tools (for GTA) written on C#.I’m working on a talking sensible robo.
    All the credits goes to you and I would to express my thanks to you for sharing these wonderful thoughts and post.^_^

  30. Rk
    August 6, 2011 at 12:24 PM

    can u please tell what will happen if i install windows update.
    I am using windows 7

  31. Rabin
    August 8, 2011 at 4:13 PM

    Yes it definitely works. thanx for the post :)

  32. RYME
    August 8, 2011 at 4:46 PM

    …? My Regedit isn’t working, it says: “Registry editing has been disabled by your administrator.” Even though i opened it again, by using “Run as administrator” it still gives me the same pop-up message, and won’t let me access it!! Help!! How do i enable it??!!??

    • Srikanth
      August 11, 2011 at 11:52 AM

      @ RYME

      I suspect your PC to have a virus/malware infection. Perform a full system virus scan and see if it helps!!!

  33. Manish
    September 6, 2011 at 5:35 PM

    it’s really amazing.

  34. Nishan Pandit
    September 17, 2011 at 4:10 PM

    It only works on the computer where u have done the above info. not in the pendrive or usb

  35. haravinth
    September 19, 2011 at 3:25 PM

    for 62 bit how its work.
    what a trick……….

  36. Sam
    October 5, 2011 at 9:49 AM

    How to create own bootable file?
    Can u help please!!!!!

  37. Y0g35h
    October 14, 2011 at 7:14 PM

    Hey dude my pendrive is already write protect but its not a re enable so how can i do to re enable my pendrive plz tell me dude

  38. Jaybee
    October 30, 2011 at 5:15 AM

    This stuff is soo cool.. nobody messes with my system and flash drives again.. Thanks man!!

  39. gyana 001
    November 11, 2011 at 11:43 AM

    well i wana to instal xp wid the help of usb device….will u help me ??? i shall be highly thankful to u 😉

  40. Rakesh Sahu
    February 1, 2012 at 11:10 PM

    Thank you very much sir very nice tricks.
    It’s working…….

  41. spidy
    April 15, 2012 at 8:57 AM

    hii… Srikant

    yr site is amazing and full of hacking tricks.

  42. saad
    June 7, 2012 at 6:04 PM

    sir,u r great,thanks 4 all,

  43. Alven
    July 17, 2012 at 1:25 PM

    I’ve know a lot on this site.. keep going men..!! hehehehe..

  44. Sajjad
    August 26, 2012 at 4:29 PM

    but this technique only make the flash drive protected in users(my) computer..but it’s not protected when it’s used in others’nt it?and its nt alwys possible to edit d registry of others how can this bug be fixed???

  45. HHH
    September 12, 2012 at 7:43 PM

    How to run .bat file automatically when pendrive is connected?

  46. Arun
    October 6, 2012 at 5:30 PM

    thank you iam using winbubble to lock write protected now no need winbb… thank you

  47. krishna
    December 30, 2012 at 11:32 AM


  48. Jeah
    February 9, 2013 at 12:25 PM

    Thank you so much for this! It really helps! :)


  49. SAIKAT
    March 3, 2013 at 10:44 AM

    i think this will work for me only… if someone use my pendrive he can easily use / write to my pendrive

  50. kunal gupta
    July 29, 2013 at 9:37 PM

    hey can u please tell us how can we remove this write protection ?? by mistake my pendrive is write protected and i want to remve that protection

  51. Seye Cole
    January 23, 2014 at 1:38 PM

    Hi guys,

    Here is my challenge: After setting the write protect on my external hard drive, i figured i could copy files and folder from the hard drive to my computer but i couldn’t copy anything from my computer to my hard drive.

    Here is what i really want: I want that i shouldn’t be able to copy anything from my external hard drive to my computer. Thus, the reverse of the challenge stated above.

    Please help me as this is urgent. Need to get this done for a client for some bucks. Y’all know what i mean. Lol!!!