How to Set a Folder Password

Posted by Roy Sudipto | | , | 3 comments »

Here is the Trick to Lock a Folder with Password , and its very simple.

1) Just copy the code below and paste it into Notepad. Save it by giving it any name you choose. Assuming, the file is called
test.txt, change the extension to ‘.bat‘ so that the new name becomes test.bat.
2) You can edit this batch file to change the folder name and the password.
3) To change the name of the folder that is created, change the ‘test’ (in bold in the above code) to any another name you choose. Likewise change the ‘pwd123′ (in red in the code) to anything else.

How to use it
===========
4 ) Place the (bat)file in the location where you would like to create your protected folder. Run the batch file by double clicking on it. This will create a folder named test in the same location as the batch file.
5) You can now open this folder and place any files in it. Once you are finished, run the batch file again. You will be asked whether you want to lock the folder. Entry ‘Y’ (for Yes) and hit Enter.
6) The folder becomes invisible. To retrieve the folder, run the batch file again. You will be prompted to enter the password. Enter the password, hit enter and voila! the folder appears.

CODE
====
cls
@ECHO OFF
title Folder test
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST test goto MDLOCKER
:CONFIRM
echo Are you sure u 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 test "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%==pwd123 goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" test
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md test
echo test created successfully
goto End
:End

If the above code dosen't works, the problem might be with the quotes used in the code in this post. Once you copy the code you would also need to change each of the double quotes with your keyboard double quotes or CLICK HERE to download.

Here is the Trick to Lock a Folder with Password , and its very simple.

1) Just copy the code below and paste it into Notepad. Save it by giving it any name you choose. Assuming, the file is called
test.txt, change the extension to ‘.bat‘ so that the new name becomes test.bat.
2) You can edit this batch file to change the folder name and the password.
3) To change the name of the folder that is created, change the ‘test’ (in bold in the above code) to any another name you choose. Likewise change the ‘pwd123′ (in red in the code) to anything else.

How to use it
===========
4 ) Place the (bat)file in the location where you would like to create your protected folder. Run the batch file by double clicking on it. This will create a folder named test in the same location as the batch file.
5) You can now open this folder and place any files in it. Once you are finished, run the batch file again. You will be asked whether you want to lock the folder. Entry ‘Y’ (for Yes) and hit Enter.
6) The folder becomes invisible. To retrieve the folder, run the batch file again. You will be prompted to enter the password. Enter the password, hit enter and voila! the folder appears.

CODE
====
cls
@ECHO OFF
title Folder test
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST test goto MDLOCKER
:CONFIRM
echo Are you sure u 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 test "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%==pwd123 goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" test
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md test
echo test created successfully
goto End
:End

If the above code dosen't works, the problem might be with the quotes used in the code in this post. Once you copy the code you would also need to change each of the double quotes with your keyboard double quotes or CLICK HERE to download.

3 comments

  1. Sopnay - The Dream // November 19, 2008 at 11:25 PM  

    boss you forgot that you are in a Windows world...why you need to take soooo much effort for that? WIndows XP it self gives that option, infact there are huge number of free tools/software which are really great...and works smooth and gives many options like setting multiple level of protection

  2. Sopnay - The Dream // November 19, 2008 at 11:26 PM  

    boss you forgot that you are in a Windows world...why you need to take soooo much effort for that? WIndows XP it self gives that option, infact there are huge number of free tools/software which are really great...and works smooth and gives many options like setting multiple level of protection

  3. sudipto // November 20, 2008 at 6:00 AM  

    Yes you are correct there are lot of tools and softwares but here you dont need to install anything , just enjoy the power of DOS , also added is the invisibility advantage .