Pages

Friday, November 4, 2011

Easy way to Write Protect a USB Drive


Protect PAN Drive

All you have the question that how to write protect a USB drive so anybody can't copy/paste data on your USB/PAN Drive, 
This is possible with the given Batch Script Code -

: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


You just copy above code into a Notepad file and save that file with .bat extension mean if you are creating a file with the name USB-PROTECT then put the USB-ROTECT.bat as a file name while saving it..


If you are not able 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.

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

4 comments:

  1. I've been browsing online more than 3 hours as of late, but I by no means found any fascinating article like
    yours. It is lovely value sufficient for me. In my
    opinion, if all website owners and bloggers made excellent content as you probably did, the internet might be much more helpful than ever before.


    my weblog ... Employment Agency Orange County

    ReplyDelete
  2. Great post. I used to be checking constantly this weblog and I'm inspired!
    Extremely useful information specially the closing part :)
    I care for such info much. I was seeking this certain information for a very lengthy time.
    Thanks and best of luck.

    my web blog: medicine for dogs - ,

    ReplyDelete