Google+

Monday, May 6, 2013

Easy way to write protect a USB drive

To write protect a USB drive follow this simple steps and you are done.

>> Open notepad and copy the Batch script code below to it.


:main
@echo off
cls
echo. & echo. & echo.
echo USB Write Protect program
echo ________________________________
echo. & echo.
echo 1. Lock the USB Drive
echo 2. UnLock the USB Drive
echo 3. Exit
echo.
set/p “ch= [>] Enter: “
if %ch%==1 goto lock
if %ch%==2 goto unlock
if %ch%==3 goto exit
goto main
:lock
cls
echo. & echo. & echo.
echo [+] Attention:
echo.
echo Make sure that there is no USB Drives inserted.
echo.
echo ————————————————
pause
reg add HKLMsystemcurrentcontrolsetcontrolStorageDevicePolicies /t reg_dword /v writeprotect /d 1 /f
pause > nul
goto main
:unlock
cls
echo. & echo. & echo.
echo. & echo. & echo.
echo [+] Attention:
echo.
echo This operation doesn’t require to Unplug the USB Flash Frive
echo so Continue without FEAR.
echo.
echo —————————————————
pause
reg add HKLMsystemcurrentcontrolsetcontrolStorageDevicePolicies /t reg_dword /v writeprotect /d 0 /f
pause > nul
goto main


>> Save the file with extension " .bat " .Example : usbprotect.bat

>> Now double click on the saved file you might see a similar window as below :
    

Thus you are done.!!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you are unable to protect your USB Drive with the help of script file then just try it by following few simple steps because Protecting an USB drive depends on Registry and you can do it manually.

  1. Simple Steps that you have to follow :-
  2. Start > Run > type "regedit" to open regisry editor
  3. Navigate to this: HKey_LOCAL_MACHINESystemCurrentControlSetControl
  4. Create a new key with the name "StorageDevicePolicies"
  5. On the right side, Create a new "DWORD Value" with the name "WriteProtect" and give it    "1" as Data
  6. Then put the USB Flash Drive.
  7. Try to Delete a file OR Copy something to it, You will not be able to do that in your system.
  8. To disable this feature, just change the value  from 1 To 0



No comments:

Post a Comment