How To Password Protect a Folder in Windows 10

  • MORE

password 18 click enter

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. 

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
  • 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??

  • Jonathan G Says:

    Works fine, but I'm not sure why you say you can delete the batch file. If you do that, you can't access your folder.

  • Cee Cee Says:

    I locked my images and now i cant access them. I can get into the locked file but none of my pictures show up. if i search for them in the search bar then they come up but i cant access them. i get a message saying "windows photo viewer cannot open this picture because either the picture has been deleted or its in a location that isn't available. why on earth have my images disappeared and how do i recover them?!

  • Apoorv Says:

    The .bat file has been lost during disc partition.What should i have to do to recover my files.

  • Alexander Says:

    When I lock the Locker folder then Locker folder disappear but new folder "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" appears
    and all "secret" files can be seen. I double check the process. What should I do?

  • Aman Mishra Says:

    Don't Worry Though You Lost Your Files.
    If You Still Can Remember The Folder/File Names Then You Can Just Search Them Under The Search Bar.

  • Aman Mishra Says:

    "Do Not Try This"
    ~~Though You Put A Password The Files Easily Can Be Found~~

  • Abhishek Yadav Says:

    My private files in private folder are not showing please do th needful

  • Rushikesh Says:

    Locker folder is displaying after entering the password

    Please relpy quick

  • Jigar shah Says:

    After entering password the folder locker is not comming.

  • Sneha Says:

    When the Folder is locked and if we double click on it, its asking for password (good) but if we simple right click on FolderLocker and click on "edit", the password is easily visible after "if NOT %pass%==" which is identical and the folder can be easily unlocked by any other user.

    Please advise

  • Garvit Gupta Says:

    how to unlock folder
    if i forgot password.

  • Think Says:

    Another tip: rename the .bat file with an obscure name, if someone sees it, they will not realize it's function

  • Think Says:

    Sohail Anwar; make a new .bat in the location where your locker is, click and unlock it!

  • Think Says:

    A very easy solution to prevent someone from accessing the locker: move the .bat file to a different folder than where the locker is!

  • Sohail Anwar Says:

    i lost my .bat file . i don't have a place to put the password in. what should i do now? please help me.

  • Mike F Says:

    Hi there. Maybe I'm being stupid, but if the windows batch file FolderLocker.bat is still present after the folder has been locked (which it has to be in order to run it to unlock), why can't anybody just right click FolderLocker.bat and choose edit, in order to see the password? Having read through previous comments, it seems that this method has bigger problems in any case. So, looks clever but probably doesn't really work is my verdict

  • Ole S Says:

    a nice piece of code, fun at least. to those who cannot unlock their "locked" folder, read what Andrew said, locate line
    if NOT %pass%==Your-Password-Here goto FAIL

    now uncomment it with // :
    //if NOT %pass%==Your-Password-Here goto FAIL


    now it accepts all passwords:)

    have fun:)

  • Faesa Fathima Says:

    how to change that password...

  • Andrew Says:

    Everyone, relax. All you need to do is right click the .bat file and choose 'edit'. There, you can edit your password, or re-copy the script from the above guide to make sure things are working correctly. Stop freaking out. It's the most simple fix possible. You people need to be more willing to try different things instead of giving up and assuming the world is going to end.

  • Mr. 'Q Says:

    Folder will not unlock. Lost all my files. Shady... :(

  • rani n Says:

    its an old trick to hide files on dos prompt....nothing new ..all the files would be visible wen u login with different user acc lol

  • IgorP Says:

    I did it exactly as you explained and I cannot get it to open the locker. I lost all my family pictures. Terrible guide.

  • Willian Says:

    When I do this everything seems to work correctly. I am able to run the script and 'lock' the folder and run it again to 'unlock'.
    However, once it is 'locked', an object shows up in the folder named (starts with) "Control Panel.{21EC2020-3AEA-...) and when I open that 'object' all my files are clearly visible just like they are in the folder when unlocked? This does not seem to do anything except rename the folder and make it hidden. I created a new user on this laptop, logged in and could drill down to the object and see all the files without running the script or using the password. This does not seem to work.

  • kevin Says:

    I've tested this three times and run it for a few days to make sure it doesn't suddenly turn on me, and all I can tell you is it works perfectly if you adhere to the instructions.

  • avinash gond Says:

    thanks man it's working for me......thanks a lot

  • Akachukwu Says:

    Please i tried your procedure and now i cannot unlock the folder. keeps telling me invalid password. how do i solve this?


Back to top