This tutorial will guide you through the steps required to create a password protected folder in Windows 7 – without installing any additional 3rd party software.
9/27/15 Update: although the screenshots will be different, the method outlined in this tutorial to create a password protected folder does work in Windows 8.
Background and Limitations
While the steps below will guide you in creating a hidden and password protected folder, this method is not 100% secure. It will deter the average computer user enough, but an advanced user will be able to access the contents of this folder. If you want to create a truly secure and encrypted place to store files and folders that absolutely nobody will ever be able to access, see the tutorial How to Securely Store Files in Windows (which requires installing software, but it’s completely free). You may also want to consider simply password protecting a .ZIP file.
Creating a Password Protected Folder
- Create a new folder and name it whatever you would like.
- Open the folder, right-click on a blank area in it, then select New -> Text Document from the pop-up menu.
- Open the text file you just created by double-clicking it and copy/paste in the following text:
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_GOES_HERE 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 - In the above code, replace the key PASSWORD_GOES_HERE with the password you want to use to unlock the folder. For example if you want the password to be 123456, the line should look like:
if NOT %pass%== 123456 goto FAIL
- Save your new file in the .bat format with the complete file name being locker.bat. To do this, make sure to change the Save as type: to All Files (*.*).
- In the folder you created back in Step #1, double click the locker.bat file and there will now be a new folder named Private where you can put anything you want.
- Upon exiting, double click the locker.bat file again. It will prompt you to answer whether you want to lock your folder or not. Press Y and the private folder will disappear.
- In order to retrieve the Private folder, all you have to do is double click the locker.bat file and enter the password which you set in Step #4 and the folder will appear again for you to access.
- That’s it!
Again, this method is not truly secure. How to Securely Store Files in Windows will take you through the steps to create a really secure folder (using free software).
MASSIVE THANKS GOD BLESS
very helpfull, Thanks Sir, I Like your help, :)
WONDERFUL…
extremely good tutorial helped me a lot thanks
wonderful working
The tutorial was clear on how to do one by one step, even better than most of videos online.
Very helpful too.
Thank you!
thankkkkkk youuuuuuuuuuuuuuuu soooooo much
brilliant, thank you
woow,this actually works!!
thanks a lot man
this is cool:D
Thanks!
really….. its very hlpfull for lock the personal folder
Cool !!!!
It made easy not only to secure data but even to hide it…
You are just too good. I tried your procedure and it worked perfectly. Thanks.
Thanks a Lot!! Superb
amazing it totally works!
A M A Z I N G
I did it… thanks a lot :)
this was great, thanks a lot man! ^ ^
Wow…this is wonderful..I have just tried it now, it worked perfectly.
This worked i love it. Now my sister can’t see anythings
Worked great for me, many thanks! It is for the “average computer user”, which I am and most people around me are, so I feel secure.
This works great in Windows 7 Professional. Thank you!
Truly good it really works.now i don’t need to worry about my secret data.
It works & awesome…
It’s Really Awesome…
This is fantastic!!! So simple, yet effective. Thank you!!
tysm it helped
Thank you very much…. looking for this for a long time….
awesome.. it really worked ….!!!
SO helpful. Thank you!!!
Thank you, this is awesome. Now I can hold my homework in a file without getting them deleted lol :P
thanks a lot excellent
Works great! Thank you :)
Awesome dude..
Thank you so much.. this works really well.. appreciated.. :)
This works so well!
Lovely boss.. Thanks
THANK YOU SOO MUCH!!
Thanking u, well done, thanks a lot
As you say, not 100% secure, but a perfect solution for my needs. Thanks very much.
wow man, you code guys are TOOO Cool!
Worked like a charm! Exactly what i needed! Thanks!!!!!!! ;)
thanks man thats amazing!!!
wonderful, it works perfectly fine! thank you so much!!
Superb Bro! thanks a million
man..u just made my day..thanks a ton :)
Thanks a million!
this is so awsome!
Awesome dude, thanks.
Thanks very much that helped alot.
Eaxctly what I was looking for! Thanks so much,
Great thankzzzzzzz
Thanks a lot… :)
Thank you so much for the simple instructions very very helpful!!!
ty for this :)
OMG AMAZING!!! (Not a techie, so I really appreciate this – thank you!!)
amazing it works thanks for the code
very helpful! thank you. :)
I love who ever found this out….. AWESOME JOB!!
Worked great
Thank you very much!! I could’nt believe I can do that too. I appreciate!
You’re a genius. Cheers mate!
it works!!!!thanks
OMG ! It works………..!
It’s reaLLy very awesome……….I’m haPPy nw..
thanks a lot……………..
This works! I thought it wouldn’t at first, but it does. Thanks so much!
Working nicely right now! Thanks
One problem I saw with this.
If you have the sidebar preview active, when you single click on the locker file, it shows the contents (i.e. the code) that has the password written into it. If one were to read the code, they could easily find out your password.
Any way to fix this?
dude i love u. u rock man.
simplest locker ever… I love it
Thanks guys!
It worked like a charm now!