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
  • sunil Says:

    I have done full process and got locker. I locked my file in it but when I go to unlock the locker it does not show there tell me what to do....

  • sunil Says:

    I have done full process and got locker. I locked my file in it but when I go to unlock the locker it does not show there tell me what to do....

  • Serge Says:

    It will help protect my files from my alter ego

  • Harold Says:

    Nonsense! All this does is make the folder a little bit harder for find. It just gives it a funny name "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" and sets its attributes to "hidden" and "system". Only total novices are fooled. If use a DOS shell and you do "cd c" and press tab, your in, if you do "dir /a" you see it, in Windows explorer, if you set options to see hidden system files you see it. There is no "password protection", once you know it's there you can freely enter it and read any files. Also, if you know anything about batch files, you can find the password. Use this if you want to hide from your 5 year old.

  • christine Says:

    This is actually brilliant. Not 100% secure, yes, but it has its merits. People who does not know how this process works wont be "clued up" enough to realise that you can do a search or edit the batch file.

  • Matfish Says:

    You can simply open the bat file and see the password...

  • the immortal Says:

    these steps does not work at all. dont waste your time in seeing this .

  • Abhiram Says:

    I forgot my password what do I do now. I need some files I have in there back.

  • Dhirendra patel Says:

    If anyone delete folder locker then what could happen?

  • someone Says:

    This is so bad...

    First of all, the password is written in the locker file in clear.

    Second of all, it doesn't "lock" the file or anything, it just hides it!

    In the windows explorer, just go to the view tab and select 'Hidden Items', and you'll see the folder!


    Can anyone tell me what to do if you forget the password and unable to unlock the folder.

  • EasyTechGuides Says:

    People do NOT use this method, because it is NOT secure! As a few other people already said - someone only needs to right-click on the batch file and choose "Edit" and your password is visible.

    Better use 7-zip and encrypt the folder with AES-256 encryption, right-click on the file and check "HIDDEN" (not 100% hidden this way, but at least the security part is strong).


    Use DeepSound and encrypt and hide your folders and files in audio files.

  • dsadas Says:

    I see multiple problems with this folder locking method.
    1. The batch file does not "lock" the folder in question, it only hides the folder. One could just go to the file organization settings and enable it so that they could see the "locked" folder.
    Someone could also convert the batch file to a text file and open it and see the password that you have written, and unhide the hidden folder.
    If one does not place the locked folder in an obvious place, then they could accidentally delete the folder in which the hidden folder is in, destroying all the content inside.

    However, this is a very nice piece of code, and I congratulate whoever made it for their skill.
    However, I would suggest simply making 9 folders, each labeled "1 - 9," and creating a copy of those folders in each numbered folder again and again to your liking. You can then place all your files in one of the folders you have made, and set a combo for yourself. For extra security, i would suggest naming your files ascii code.

  • John Wigglesworth Says:

    if the .bat file is visible this isn't secure, but just move it elsewhere or even delete it if you won't be using the Locker contents anytime soon.
    I did this on a backup drive. Lots of trivial stuff is visible, but the confidential stuff is inside Locker. The .bat file has been deleted.

  • Marcus Says:

    I followed all the steps... was able to succesfully lock folder. Problem... When I type password, command window disappears but Locked folder doesn't show! My mistake... I should have tried it before moving my files to the locked folder. Now I cant access my files.

  • netnema Says:

    Veracrypt portable, a replacement for TrueCrypt I've been using for many years - awesome program, and much easier!

  • jenkins Says:

    line 21, when it asks for the password, you can add a hint by typing Hint:Your-hint-here
    (i agree with Nick mabe)

  • Nick mabe Says:

    I might be wrong but surely to get the password all one has to do is right click on the Batch file, open in Notepad and hey THERE"S the Password. This code as about as secure as a WET PAPER BAG

  • GhostX34 Says:

    I don't know about you guys but it works for me.

    Maybe for others had a typo while typing your password.

  • Tina G Says:

    I forgot my password to the folder, how do I recover the files now?

  • harsh Says:

    hey! i used this trick its good at the the end when we are entering the password in command prompt and when i press enter after that it does not display my folder

  • Anjali Doshi Says:

    I tried this method to lock the folders and it worked aptly. Now, when i'm trying to unlock it, it says 'invalid password'. Do we other options to unlock it or any link where we get our password?


    dont use this method to secure your files, the password is contained it the .bat file which can be read by people. people can also still find files inside the "locker" by searching for them.

  • roan S Says:

    thanks now i can hide all the things i saved for academic purposes

  • Mohammad Ismaeel Nagra Says:

    if you want to find your lost files type them in at the location of the Folder Locker, it didn't work for me as well by the way.

  • Dee Gee Says:

    I had not too many issues
    I took my time
    the wording of the instructions was a bit dfifficult but.. it works like a charm..

    and iof you forget your pw to anything.. what do you do?write it down.. gawd..

  • Eu Ler Says:

    I am unable to create the Locker folder. It only flash something when I double click it.

  • Lachlan Says:

    I dont know what I am double clicking the FolderLocker.bat file it does nothing but flash the open folder and not create anything. All other steps before this I beleive i am doing correctly and have read and followed instuctions to the letter. Please help

  • Jessie Says:

    I tried it two times. I'm sorry to say but it's really annoying my files are gone. 😤😤😭😭

  • Christine Says:

    It wont unlock. Great! Now I can not retrieve all my files.

  • Tiffany Says:

    Is there any way to change the name of the opened "Locker" folder? Just curious.

  • AdamTG Says:

    Yeah, this would be great if simply selecting "edit" after right clicking file, one could easily see the password in plain text.

  • scarlett Says:

    hi, this is amazing but my antivirus find it as a threat. . .

  • arafat Says:

    it works fine for me , you all just didn't read properly, and realize that you made a mistake

  • Sambit Agnivesh Says:

    Hi Henry,

    Thanks for the article. It was really helpful.

  • joseh Says:

    yeah it locks that one folder. But run a search for a .mp4, file name, or pict in the folder...they come right up. So its not really locking anything.

  • LukeS Says:

    Despite what people have said below this actually worked for me, I'm really happy. I found trouble copying the text at first but after that I was fine.
    Thanks for the help.

  • abcdefg Says:

    It didn't work for me, when I locked the folder, it just faded and was renamed "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"

  • haseeb Says:

    its not secure because when you press the delete button.the locker folder will be deleted and your data will be loss

  • prashant Says:

    this is not true.because when i follow this steps are create that time i will see that it will only hide data not secure..

  • Some Guy Says:

    Maybe I didn't follow the instructions right, but I wasn't able to unlock the folder after locking it in the first place.

    But, it is actually really easy of a lock to break. Simply use the command prompt to navigate to the directory you have the FolderLocker.bat file, and run this command

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

  • needHelp Says:

    I've used this technique for a year, but this week, I don't know what happened that after I entered the right password, the Locker folder won't appear. Can anyone help me?

  • Smart Says:

    Nice try. I had all my data saved on a usb just to be sure. Dont try this people or your data is trapped in that locker. Forever...

  • sami.s Says:

    i am clerly putting in the right password and it says invalid password and i have over 200000 words in that folder and if i loose them i will be VERY annoyed

  • AadiJ Says:

    If you go to properties of folder, and click to show hidden folders, its easily accessible.

  • SAM p a Says:

    everyone can easily crack it open...just open the batch file with windows text editor....

  • SAM p a Says:

    everyone can easily crack it open...just open the batch file with windows text editor....


    Sir I forgot my password, is there any way to unlock my files?



  • Arooshi Jaiswal Says:

    i lost all my files!! i cant even find it at the search bar. what am i supposed to do??

Back to top