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



title Folder Locker

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



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.



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

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

echo Folder locked

goto End


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


echo Invalid password

goto end


md Locker

echo Locker created successfully

goto 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
  • George Carey Says:

    I gave this a try. It seems there is an easy way to see inside a 'locked' folder. Just do a search for something, eg. jpeg files by typing *.jpg in the search box. Any jpegs will appear. Now go up a level to the parent folder and you will see everything.

  • Danielle Sheldon Says:

    update to the comment below: I read through some comments, and as stated by Pierre, the FolderLocker is able to view in the preview plane in case you get stuck like me

  • Danielle Sheldon Says:

    HOW CAN I REVERSE THIS? I tried doing this on a trial folder and it worked fine. When I tried it on the folder I actually need locked, it says my password is now invalid! I CANNOT GET TO ANY OF MY DOCUMENTS FOR WORK PLEASE HELP!

  • Reza karim Johnie Says:

    Folders Are Locked But Not Showing After Entering The password...!!!

  • TheUnknown Says:

    If your talking about the app then if you already locked the folder enter the app again. The app should open

  • ADARSH Says:

    Sir I made the locker folder on the steps mentioned above but that black page is not coming on opening that folder.

  • Tiffany Says:

    If it says " The process could not access the file because it is being used by another process. File not found - Control Panel.{21EC2020 "
    What should I do now? Pls help

  • Harjinderkourdhanjal Says:

    I am looking for a few days now and I will be able to get the best way for a long way from this one,

  • Pierre Says:

    Everything is visible in the preview pane so I guess there's no point of this. Kudos.

  • Joel Hoover Says:

    When I go to change the "save as type" I don't have an "all files" option. Any suggestions?

  • Brian Says:

    works perfectly !
    for those of you that forgot your password. In Windows explorer turn on preview pane(alt-p). Select your file and you can see in your batch file.

  • The unknown Says:

    If your talking about the app then your welcome

  • Benchaa Khaled Says:

    It work great !! Thanks a lot , I don't see why people can't make this work...

  • The unknown Says:

    If your talking about the app then the password is 293

  • Arjun Gupta Says:

    sir i m not able to access to my data pls help its really important

  • Sowmya Says:

    guys its 190gb of data which I ve locked pls help

  • Sowmya Says:

    i think I ve forgottrn the password....
    but I ve tried with all possible ones but I m not able to open the lock.
    sometime I feel I ve applies the correct one . Please help

  • The unknown Says:

    download this app called folderhider it does not require a password to unlock a folder
    here's a link to it:
    don't worry this is not a virus.
    How does it work.
    1:create a new folder in your pc
    2:put the folderhider app inside the created folder
    3:open the app and enter the password 293
    4:when the app is opened you will see a folder called pf you can put anything you want inside it.
    5:once your done putting everything you need. open the app again and if you want to lock the folder press L and if you want to unlock it press u
    6:when you lock the pf folder exit the app and the folder that you created.
    7:open the file that you created again and the pf file will be hidden.
    8:if you want to unlock the pf open the folderhider app and press u to unlock it.
    That's it :)
    again don't worry this is nit a virus

  • OtaTormEps Says:

    Shivam Patel, re-open the bat file and change the password to something else, save it then re-run it and use the new password.

  • Shivam Patel Says:

    hey i forget my password but i want to use my files please help me. how can i remove my password

  • Koulini Kavi Says:

    This is fabulous..... Thank you so much for this !

  • Koulini Kavi Says:

    This is fabulous..... Thank you so much for this !

  • Jeff nna Says:

    This did nothing. I can still access, and open all of the "protected" files.

  • Len D Says:

    It worked but created a folder called Control Panel and the "hidden file appears there, unprotected.
    What did I do wrong?

  • supriya Says:

    is this good.....but there is one problem when you hide the folder and search the folder name in search option the file or folder will be there is any solution on this problem....plz reply

  • Nikita Gaur Says:

    I have forgot my password. I have tried every format I knew but it is not accepting shld I remove this thing from my folder?

  • Maksim Nilar Says:

    Hey guys,
    I think that this program is fantastic and I highly commend you for it, however if a truly determined intruder wanted to gain access to your file. They could just edit the .bat program and view the password. That's my only criticism but honestly I wouldn't have been able to do this myself, I only know a little of python.

  • hasangajayasinghe Says:

    I created a locker folder but when i tried to open it with the password it did not show up the locker folder...
    kindly help me to retrieve my files

  • Naresh Says:

    It's working. It is able to hide files in hidden folder, but this folder is not protected folder. Able to delete folder. If hidden folder is protected then this will be perfect.

  • Saniya Says:

    But there is one problem. I followed all the steps and it worked good. However, if you click hidden files, the Locker file is shown in the screen. And it can be open without any password.

  • Supervise Says:

    Whenever it asks me to choose Y/N,as I type down Y and enter it gives me "Access denied."Any reason for that or way to deal with t?

  • dinal Says:

    Is there a way to hide password with a character when we a opening that folder

  • Deepesh Mehta Says:

    Nice Trick to keep someone away unless they exactly know what they are looking for. :)

  • Jay Tomlinson Says:

    It is a very effective way of keeping my private folders safe! I have just tried these steps on my USB, and it's working perfectly!!

  • Any Mouse Says:

    This method is completely insecure, as the 'password' is stored in plain-text in a file available for preview by Windows Explorer. You should not be distributing this flawed, dangerous method.

  • AndyS7 Says:

    This isn't secure, and it's laborious. For a much quicker method, which is slightly more "secure" try the following: zip the files/folder and rename the zipped file to an image file extension, e.g. "filename.jpg" (make sure you have the option to display file extensions turned on in Windows). If someone tries to open the file the image viewer will display an error message, like "invalid image". Of course, if someone knows that the .zip file is an image they can rename it back, but they would have to *know* that first ;-)

  • Sinetto21 Says:

    This doesnt actually "lock" anything, but sets hidden and system attributes to the files. Simply opening Windows Explorer and setting your options to "Show hidden files" and unchecking the "Hide protected OS files" will reveal the contents.

    I like the idea though and maybe in the Windows XP days it would work, but these days too many people are tech savvy and would work around this easy.

  • Iwonder Says:

    This is cool. But, where to you put the .bat file so that someone can't look in it to get the password for the locked folder?

  • c morrison Says:

    doesnt work on windows 10 home ,errror mess = unauthorised changes blocked

  • Amit Dhawan Says:

    Simple enough and worked just fine. Nice option for simple hiding of files

  • Adhin kumar Says:

    i like it .this ..lokking system..

  • Conor Says:

    I did this with a folder on a USB Flash Drive. I opened up the locked folder with the password and opened the folder within that which contained all my irreplaceable files...wouldn't you know they are all gone. I turned on Show Hidden files, folders and drives in Control Panel - still missing. The Folder Locker folder has now changed into a 4KB file type for some reason that is inaccessible. The USB Flash Drive still has the same amount of storage used up so the files are still on it somewhere. I really need to get my content back, as I said, it is irreplaceable. Thank you.

  • Wasif Says:

    What if somebody delete folder locker file....????

  • Mary Grace Says:

    I've tried the folder locker and it works, but when I put my password my files dont appear anymore. How can I get it back? Thankyou!

  • Neil Kearns Says:

    Convoluted and not user friendly. Folder was still visible from documents browser so a complete waste of time, effort and computer memory!

  • Daniel Says:

    Ummm, Yeah, This "File Locker" thingy isn't exactly what I'd call a secure way to lock a file or folder.
    The files don't go anywhere, It seems it just sets the file as "hidden".
    Go ahead, try it out, then just do a Windows/Cortana search for your "hidden" filename(s), they'll still be found, under control panel/yourfilenamehere.extention

    This is NOT a safe way to "lock" or "hide" a folder, If I were YOU, I'd look into downloading a program that does this, here are several absolutely FREE options:

  • Stephanie F. Says:

    I was NOT able to retrieve my files by using my password. It did not show a "Locker" folder after I entered my password. I had to use the "search my pc" function to find the hidden folders. This did not work for me and stressed me out trying to retrieve documents. Don't recommend unless your are a "tech savvy" person. UGH!!!

  • Senthil Says:

    Is it anyway to retrieve the files?

  • Senthil Says:

    When I double clicked second time to get the folder back, it is not asking for the password. But I got the empty folder and my files are disappeared.

  • Vasim Shaikh Says:

    Files stored can be easily tracked:
    1) can edit the folder locker file.
    2) Click on "folder options" > View > Check Show hidden files and folders > uncheck all the options below which starts with word "hide" and you would be able to access the folder without even entering the password

Back to top