Friday, March 4, 2011

Prevent Virus with Write-Protect USB

A friend of mine ask if usb can be write protected so no virus would be able to copy themselves into our usb drive. I can show you a step by step on how to do it manually or just simply one click. I will show you both ways. I hope this simple tutorial will help you guys.

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:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\




Click to Enlarge


3. Create a New Key named as StorageDevicePolicies. To do this right-click on Control, and 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.



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




Click to Enlarge

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.




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.


--------------------------------------------------------------------
Or You can simply use the Bat file below to write protect you usb drive


Write Protect Instructions


Download writeprotect.bat in a zip package from here and extract the files on pen drive and double click writeprotect.bat to make your drive write protected. You will need to eject your pen drive once after launching the batch file to make your drive write protected on the computer.

Disable Write Protect Instructions


Download disablewriteprotect.bat in a zip package from here (this package is same as bove, download any of these two) and extract the files on the pen drive and double click disablewriteprotect.bat to disable write protection on your pen drive. You will need to eject your pen drive once after launching the batch file to disable write protection.



Write Protect Bat File:   DOWNLOAD

Reference: TroubleFixers