Tuesday, 28 February 2012

How To Create A Password Protected Folder In Windows

Step 1
Open new "Text Document" as shown below.


Step 2
Copy and paste below code.
...............................................................................................................
cls
@ECHO OFF
title Folder Private
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Private "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%== PASSWORD goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End

.............................................................................................................. 
You can assign any password in the highlighted line
As a example if NOT %pass%== PASSWORD goto FAIL
PASSWORD = 123456 or whatever......


Step 3
Save the "Text Document.txt" as "locker.bat"


Step 4
This is how it looks like after save.

Once you double click on that "locker.bat" file there will open folder name "Private" as shown below.


Then double click on that "locker.bat" file again. Then It will shows you a message as below


Press "Y" for hide the folder.

Step 5
In order to retrieve the Private folder again , all you have to do is double click on "locker.bat" file and enter the password that you assigned earlier.

That's it. Enjoy

No comments:

Post a Comment