Protect a folder and make it private in Windows Print E-mail

Here is an easy way to password protect a folder and its contents in Windows XP, Vista and 7.

Steps to make the contents of a folder private:
1. Create a bat file inside of the folder that you want to protect something in.

  • To create a .bat file just create a notepad text file and put the contents listed below in the text file and save the txt file as .bat file instead of a txt file, it should be locker.bat in the folder that you want to protect something in.  Click here to get the locker.bat already made for you to modify.  Remember to specify the password you want in this locker.bat file.
  • Alternatively you can use the code below, copy and paste it all into a locker.bat file that you can make form scatch. In the text below replace the password here with your own password and save the changes to the locker.bat.
Quote: cls
title Folder YourStuff
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST YourStuff goto MDLOCKER
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.
ren YourStuff "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
echo Yo, Enter your password to unlock this folder bro!
set/p "pass=>"
if NOT %pass%== password here goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder Unlocked successfully
goto End
echo Invalid password
goto end
md YourStuff
echo YourStuff created successfully
goto End

2. Watch the video tutorial by PCWizKid for complete steps and instructions to complete this simple tutorial.



PCWizKid's Tech Talk - Contact Information

Contact PCWizKid for general feedback, requests for reviewing your hardware or software product or for media and press requests.
Click here for contact details