How To Password Protect a Folder in Windows 10

  • MORE

We all have computer files we'd like to keep secret from the world. Fortunately, in Windows 10, you can tuck those unmentionable plans or files in a secret folder that is password protected, and you can do it without buying any additional software. 

password 18 click enter

A note before you start:

We've recieved comments about issues people have run into with this how-to. So, we went back and performed multiple rounds of testing internally, and can now confirm that following this process closely, step-by-step, should work.

Just to be safe, try it out once using a file that isn't important, so you can make sure it works for you. Also, yes, the FolderLocker file can be reverse engineered by someone who understands the process, but this isn't meant to keep tech-savvy folks out, just nosy family members who you don't trust.

Here's how to create a folder that you can fill with files you want to keep secret, lock it, open it and repeat.

 

How To Lock a Folder With a Password in Windows 10

1. Right-click inside the folder where the files you want to protect are located. The folder you want to hide can even be on your desktop.

password 01 find folder

MORE: How to Change Your Password in Windows 10

2. Select "New" from the contextual menu. 

password 02 right click

3. Click on "Text Document."

password 03 select new

4. Hit Enter. It doesn't matter what the file will be named. You can delete this text file once the lockable folder has been made.

password 04 hit enter

5. Double-click the text file to open it.

password 05 double click

6. Paste the below text into the new document:

password 06 paste

cls

@ECHO OFF

title Folder Locker

if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK

if NOT EXIST Locker 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 Locker "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%==Your-Password-Here goto FAIL

attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"

ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker

echo Folder Unlocked successfully

goto End

:FAIL

echo Invalid password

goto end

:MDLOCKER

md Locker

echo Locker created successfully

goto End

:End

7. Find where it says "Your-Password-Here" in the document.

password 07 find yph

 8. Replace "Your-Password-Here" with the password you want to lock the folder with.

password 07b replace with pass

9. Click File.

password 08 replace with pass

10. "Select Save As..."

password 09 save as 2755011437675936

11. Click on the "Text Documents (*.txt)" menu bar that's next to "Save as type:"

password 10 select text documents

12. Select "All Files"password 11 select all files

13. Change the file name to "FolderLocker.bat"password 12 rename to folderlocker

14. Click "Save."

password 122 save

15. Double-click FolderLocker.password 13 doubleclick folderlocker

The Locker folder has been generated!

password 14 fill your locker

16. Fill the Locker folder with the items you want to protect.

password 15 fill your locker2

17. Open the FolderLocker file, because it's time to lock that folder up!

password 16 doubleclick folderlocker

18. Type "Y" into the screen.password 17 type y19. Click Enter, and the Folder Locker window will disappear, along with the Locker folder itself! Your secrets are safe!

password 18 click enter

To unlock the folder, double-click "FolderLocker" to open it.password 19 double click folderlocker

Enter the password you entered in Step 8, and click Enter.

password 20 enter password

password 21 click enter

The Locker folder is back. You can open it to find your hidden files. Repeat Steps 17, 18 and 19 to lock the folder again.

password 22 lockers back

password 23 along with your secrets 2755011437677439

Author Bio
Henry T. Casey
Henry T. Casey,
After graduating from Bard College a B.A. in Literature, Henry T. Casey worked in publishing and product development at Rizzoli and The Metropolitan Museum of Art, respectively. Henry joined Tom's Guide and LAPTOP having written for The Content Strategist, Tech Radar and Patek Philippe International Magazine. He divides his free time between going to live concerts, listening to too many podcasts, and mastering his cold brew coffee process. Content rules everything around him.
Henry T. Casey, on
Add a comment
365 comments
  • Goodzone Lo Says:

    I followed everything but when I entered my password, it does nothing and closes. Can you help me on how to retrieve my folders, please?

  • Roshan Says:

    Just turn on ' Hidden files and folder' and you will see a hidden folder. Open it and you will be able to access all your files without password. So much coding just to hide a folder, I will rather hide the folder myself. NOT useful.

  • Roshan Says:

    Just turn on ' Hidden files and folder' and you will see a hidden folder. Open it and you will be able to access all your files without password. So much coding just to hide a folder, I will rather hide the folder myself. NOT useful.

  • WulfricLucian Says:

    For those who forgot their password just right click on the .bat file and select edit option. this will open the file in notepad and you can see or change it from there.

  • kumar Says:

    This folder lock is helpful but files location can be open by entering either file name or format in the search option of Windows and it redirect us to inside the locked folder.

  • Nandan Says:

    What if I permanently delete this batch file accidentally? What happens to all the contents of the hidden folder?

  • Yves Isabelle Says:

    The locking BAT file is not encrypted there can be edited for password.

  • Debbie R, Says:

    This is seems useful, mayeb, not sure yet.

  • Farhan Says:

    files are accessible via file and folder search option.

  • Steve Says:

    One problem with this is that if you have preview enabled on the right hand side then you will see the password lol

  • Aaro Salonen Says:

    In case you wish full privacy, this isn't the way. If the file type is pinned in to your quick access, you can still right click the program to view latest file names, and open any one without needing to know the password.

  • Ghosthumanpro99 Says:

    Thanks man it worked for me, I have windows 10

  • Parul Says:

    I have locked the folder following above process however I have forgotten the password
    please let me know the way to unlcok

  • Avery Says:

    I'm adding this to my previous comment (which is below):

    Do not use the method described in this article. Use encryption instead. If you're trying to protect a folder, and you don't really need to edit the stuff in there, use 7-Zip. 7-Zip supports AES-256 encryption. AES-256 is so hard to crack that it's used to protect military information. All you have to do is make an archive in 7-Zip, and there will be an option to password protect the archive.

    If you want to protect something you edit a lot, make a virtual drive, make a partition, format the partition, protect the partition with BitLocker, and then mount the partition to a folder. REMEMBER, if you need any help, contact me in Discord: MorRutPlz#2639

  • Zainab Khalid Says:

    woooahhh!!! thank you so much i really liked it thanks again!!!

  • Hesam Says:

    Thank you so much
    it's so helpful

  • Elizabeth Manuel Says:

    I forgot my password to the file. Any way I can reset the password to the folder?

  • RudeBoySes Says:

    works perfectly. thank you, you saved me money. was about to buy an app for this :)

  • shreelekha Says:

    i successfully locked it. but after typing the password the hidden locker file is not coming back.
    please help..!!

  • 5h4d3 Says:

    The folder is just hidden,show hidden folder and there is your so called secure folder

  • Ketan Says:

    I created a locked folder successfully a few months ago, but have since forgotten the password. Is there a "Forgot password" function?
    Please help...

  • Joshua Says:

    Successfully hid the folder, but then I could never get it to reappear.

  • Boris Says:

    Yeah... you have to double left-click.... not double right click

  • Lugknuts Says:

    But if you right click folderlocker.bat and click edit, you can see what the password is supposed to be... so for the person who forgot their password, edit folderlocker.bat and go in and change the password to what you need it to be.

  • :DDDDDDDDD Says:

    Worked perfectly thanks!!!!!!!!!!

  • artisticMess Says:

    Hey, I followed this step-by-step, and it didn't work... at all.

  • Santhosh Says:

    Yes.! Under edit option, the password is visible and editable.

  • Shripad Says:

    If we search for the document in the search menu which is provided on the top right, whole document is revealed.

  • T. James Says:

    hello, I would just like to point out a major flaw in this, all someone would have to do is right click on the bat file, click edit, and then they have the password. any way to encrypt that bat file?

  • Abhishek Says:

    i have encrypted a folder with this process, after some time my folder is not showing after unlocking the folder using passowrd

  • Clyde Says:

    Fun little project, but not really secure as you can just edit the .bat and see/change the password

  • Liban Says:

    This method is too complicated for beginners like me.

  • A Random Dude Says:

    If you have your settings put to show hidden folders like I do then this literally does nothing!! It just changes the name and makes it a hidden folder if you dont hide the contents inside the folder you can still search them out this is literally nothing. It'd be better to just hide the files inside a program file.

  • ERTEM YAZICI Says:

    It is the most stupid and moronish lock app i have ever seen as 16 years programmer.

  • qwertyuio Says:

    not secure at all. I can open FolderLocker.bat through notepad and see the password.

  • alex Zhou Says:

    How do I remove this setting? what if I want to remove this password?

  • Teva Smith Says:

    Hi,
    I did this an now my folder wont unlock.

  • charbel Says:

    thank you, but there is a problem! anyone can right click on the .bat file, go to edit and change the password.
    what can be done?

  • jack kint Says:

    thanks it worked beautifully first try

  • Sampath Ruwankumara Says:

    It is not totally protected. It is depend on "folder option". it can be view changing "folder option" settings.
    How ever Thank You friend....

  • Sadiqullah Says:

    Open folder lock wy did not open loock folder

  • samsara Says:

    Thats what I needed. :) Thank you

  • Bunheng Says:

    Thank you for your help sir. It's working.

  • andy bong Says:

    If the .bat file stays there someone could just right click>edit and see the code and an then see the password there... I guess it would work against someone who doesnt really know what a bat file is, but this isnt by any means a secure password protection system.

  • Mazimations Says:

    Well, this sort of works. All it does is hide the folder until you type in the password to unveil it again. Not as secure as I had hoped, but it keeps the files away from the average mind.

  • Dan D Says:

    DO NOT DO THIS IF YOU ACTUALLY WANT YOUR FILES UNFINDABLE. A simple search will reveal every file in the folder. Useless for securing or hiding files and this is a very misleading article.

  • Monirul Says:

    Thanks. It is most helpful for me.

  • Jmarie Says:

    You can open the folder with other software like WordPerfect. Not secure.

  • Piumra Says:

    Wowwww it works....works very well when use every time.

  • Computer Guy Says:

    The problem with this method is the password is in the .bat file. Anyone with a little know how can open the .bat file and retrieve the password

Back to top