GoHacking.com: Ethical Hacking and Cyber Security
Home » REGISTRY HACKS, USB HACKS, WINDOWS HACKS

How to Write-Protect Your USB Flash Drive

Submitted by on Thursday, 24 February 201147 Comments

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. Because 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.

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. Just follow these steps:

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

  2. Navigate to the following Registry key:

  3. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\

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

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

    Write-Protect USB Drive

  6. 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:



By using/following this site you agree to our Legal Disclaimer

47 Comments »

  • Ankit Das said:

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

  • Srikanth (author) said:

    @ 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.

  • Om Kumar said:

    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.

  • shan said:

    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

  • Sumeet Kukreja said:

    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?

  • Gaurav Garg said:

    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 http://www.hackersfind.com

    Thanks If You Post Related To HDD Safty

  • Srikanth (author) said:

    @ 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.

  • Om Kumar said:

    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.

  • DEVIL'S BLOG ON SECURITY said:

    Nice registry hack

  • sam said:

    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 … : )

  • madhu prasad said:

    Yes,
    It is working.
    Thank you.

  • sam said:

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

  • Hack Primium Account said:

    Fantastic Tutorial Dude !!

  • rajkumar said:

    hello shrikanth
    this is a good one post
    but my question is IS THERE ANY PROGRAM WHICH CAN LOCK USB LIKE A folder lock WHICH REQUIRE PASSWORD WHILE CONNECTING IN EVERY COMPUTER
    .

  • Deep said:

    Nice trick sir……….

  • Rishi said:

    Great !!!! it Really works

  • @Nasim said:

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

  • abhishank said:

    nice tutorial..

  • Ramraj said:

    nice work…it realy works

  • Vamsi @ HoverPcHacks said:

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

  • AllCelebrityBlogs said:

    Hey,

    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?

  • Jamie said:

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

  • Tharun | Technostreak.com said:

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

  • Zeeshan said:

    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 (author) said:

    @ Zeeshan

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

  • Adrien DAVIN said:

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

  • sri said:

    how to make a cd/dvd uncopyable plzz reply me

  • Abdi fatah farah Ali said:

    ok.nice work…it realy works

  • siva_phd9 said:

    A very useful article.Thanks for sharing

  • Rk said:

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

  • Aniket said:

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

  • Sarvesh said:

    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.^_^

  • Rk said:

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

  • Rabin said:

    Yes it definitely works. thanx for the post :)

  • RYME said:

    …? 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 (author) said:

    @ RYME

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

  • Manish said:

    it’s really amazing.

  • Nishan Pandit said:

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

  • haravinth said:

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

  • Sam said:

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

  • Y0g35h said:

    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

  • Jaybee said:

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

  • gyana 001 said:

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

  • Rakesh Sahu said:

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

  • spidy said:

    hii… Srikant

    yr site is amazing and full of hacking tricks.

  • saad said:

    sir,u r great,thanks 4 all,

  • Alven said:

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

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.