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
  • Ali Hassan Says:

    nice work man , but anyone can change password by simply right clicking and opening .bat file by notepad..., moreover you can directly access to that files you hide by simply pasting this in address bar of file explorer when you are in that folder where folder locker.bat file this"D:\Camera Backup\Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"

    only paste this" Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} " in that folder's address bar where bat file is.. and you are done

  • Ashen savinda Says:

    Thanks man..Tht was really awesome!!

  • Michael Says:

    mine doesn't let me in, where's the tutorial on how to reverse it?

  • johnnyRose Says:

    This is a joke. This method stores your plaintext password on your filesystem and doesn't utilize encryption, so it's essentially useless. This is such bad advice. DO NOT DO THIS.

  • U s e r Says:

    I freaked out at first because I moved my .bat file into a labyrinth of folders and when I tried to retrieve my pictures, they were nowhere to be found. I since realized that seeing it depends on the location. If you store something in the .bat drive deep in several folders, that's the only place you can put the .bat file to open them. Anywhere else and the folder will be empty. If you think about it, it can be a great way to hide folders (of course not on a professional level as most people are pointing out)

  • HEY! LOOK! LISTEN! Says:

    Make sure you do not forget to remove the entire "your-password-here" text.

    If you have an issue. Simply right click the folderlocker.bat you created, click edit to check your password for any slip ups and save it same as you did before.

  • Tom Holland Says:

    Amazing! Love how well this works. I can't thank you enough. Along the same line; how could I protect multiple folders within a folder?

  • YU Zhang Says:

    It works very well in the beginning, but after several tires it does not accept "Y" to lock. No more works

  • Jason Says:

    It worked and I found it useful. Thanks.

  • Katie Wilson Says:

    Please help me! Why I am not able to unlock the locked folder though I have typed the correct password for many times? The folder did not show up.

  • Morris Says:

    When you search for specific files in the locked folder, you can still find them after password protection. :-(

  • ankit bhaskar Says:

    this method is are just fooling people.FolderLocker just hide the folder which contains documents. If you just click show hidden files the folder will be shown. Schooltime tricks.

    So who has got bat file deleted just search for your file and it will be shown.


    The batch file got deleted by mistake. Now whatever method I am using to see the folder, I am not able to get it. Can somebody please help me in retrieving the folder.

  • Lissiebeth Says:

    Hey! Thank you for making this post, it definitely worked!

    People in the comments are complaining of people opening the folder where you have the password. No problem, just delete the file containing the code. Easy peasy. Nosy family members can't find my sensitive files, which is why I looked this up in the first place. I think this is worth it. Thanks again!

  • Chuck Morranger Says:

    But won't someone just open the .bat file and find the password if capable of doing so?

  • Or El-Hai Says:

    This will only work if the OS is configured to hide system files. in Windows 10 you can easily tell the system to show system files, and then this trick doesn't do the job.

  • Jay Tomlinson Says:

    Really helpful steps have been provided and I've created one! However, shortly after I had saved my pictures in the Locker folder, I can't hide it again although I type "Y" to hide. Please help!

  • Mohiuddin Says:

    I get stuck in step 17 . The locker don't strat .when i try to open it ,it dissapear . But i really need to lock some off my important floder.

  • Amit Jha Says:

    What is the use when anyone can open the bat file and change the pwd in it and then use new pwd to open locker folder?

  • Darkmatter4387 Says:

    Thank you much this will hide many good pupper files that I must hide from certain people...

  • shayna Says:

    This is amazing. I am not very tech savvy, but loved doing it. It was fun and served my purpose too.

  • gerald Says:

    doesn't work & the .bat file is not secured. its like leaving the key inserted on a locked door..

  • anonymous7315 Says:

    This is not secure! The .bat file still exists on disk and your password is in clear text!!

  • Richard Moore Says:

    This is a great , how-ever if you do a *.extention (example: *.jpg) in the folder search or pc search. Any file in the lock folder will appear in the search even if you have the folder lock. Is there a way to lock the files all together. you can do a hide but any-one can click show hidden files. if you have a solution i be very great-full. We have kids and they use my pc and momma and I don't want them to see our files that are private.

  • Raviteja Says:

    Is it Works in Share Folder also ???

  • Ajay zutshi Says:

    it doesn't work on my system as it it is of windows 10 in spec.(hp15 ay053tx). After pressing Y as yes option instead of locker a folder named something like controlpanel1234.... and so on and I want a solution to fix this. Please I am in very deed.

  • claire Says:

    Step 15 (double click the batch file) just does nothing for me. Any suggestions?

  • Jenny Says:

    I am in the same boat as some other users. Set this up and it won't accept my password. Literally nothing happens. Have tried showing hidden files and nothing there, so where have my files gone!

  • Nimgol Says:

    Thanks! But I have a little problem with that.
    Anyone who R/clicks on this .bat file and finds the Password, can easily replace it with whatever password they want and they can open the folder!

  • Michael Says:

    WindirStat (used to analyze disk storage) will find the hidden files no matter you hide with this FolderLocker. Files are even executable directly from Windir Stat.

  • Vijay Says:

    Files can be easily found by search option.

  • Asad Abdul Majeed Says:

    The File can't move
    it direct open with

  • Dan the Computer-Man Says:

    Yes, this is obviously not "real" security, but as stated, for the avg person it will work - but here is a MAJOR IMPROVEMENT that for me actually makes it usable ...

    1) I named my file with a simple name lock.bat
    2) I added
    attrib +h +s lock.bat
    attrib -h -s lock.bat - although I am debating not doing this and keeping the file hiddle as it is not needed to be seen with this method.
    3) I LOCK my folder (which I also named something other than LOCKER but that was just to name it wanted I wanted it called)
    4) to UNLOCK my folder, I put in my ADDRESS-BAR (this is a USB-key in drive E) e:\lock

    It prompts me as normal - the difference, if someone just looks at my drive, they do not see the lock.bat file at all, and I know the name so all is good ... and of course, you can put the lock.bat in the root-folder and still lock/unlock some subfolder 3 levels down with very minor changes.

    Realize this is NOT security but it is convenient especially for users of a new product we're about the release ... we normally use bitlocker but this is good for a lower-level of security.

    Thanks for this :)

  • B C GH I Says:

    For those who forgot their password:
    Select show hidden items in folder and search toolbar

  • sciup-1 Says:

    Terrible, it is very unsecure. The files are very easy to find with "Search", Moreover by opening the .bat file with notepad everybody can easily read the password.

  • Malinga Rajapaksha Says:

    Thanks it was very Helpful..................................................................

  • tapasvivyas Says:

    thanks a lot to you that you gave us a brilliant method for password encryption that too without any app.

  • Johhny Day Says:

    is there a code where if you type the right password it opens and if you enter the wrong one it opens a different "locker"

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

Back to top