How To Password Protect a Folder in Windows 10

  • MORE

We all have computer files we'd like to keep secret from the world. Whether you're working on taking legal action against someone with access to your computer or (hopefully) something less drastic, you're allowed to hide things from others. 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, works — at least on our end.

But just to be safe, you should first try this how to using files you can lose, stuff that isn't important. Also, make sure you're keeping some record, somewhere, of the exact password you're using to lock your folder. If you lose the password, your files are gone.

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,
Henry is a senior writer at Laptop Mag, covering security, Apple and operating systems. Prior to joining Laptop Mag — where he's the self-described Rare Oreo Expert — he reviewed software and hardware for TechRadar Pro, and interviewed artists for Patek Philippe International Magazine. You can find him at your local pro wrestling events, and wondering why Apple decided to ditch its MagSafe power adapters.
Henry T. Casey, on
Add a comment
414 comments
  • Himani Says:

    I have used this method. But the folder got locked and after writing the similar password so many times, i am not recovering my photos back. Hope u can help me with this asap.

  • Daniel Bernard Says:

    This works for me. I also tried to hide / protect a folder on my NAS. It works when I try to access the folder through my laptop! That's good. When I tried to access the same folder (on the NAS) through my Iphone it asks for a user name and password. I tired different options for a user name including leaving it blank. No go. Other than that it works fine

  • Kathleen H Maloney Says:

    Just an FYI for some: These instructions worked as described (Thanks!!), except when I went to reopen the newly password protected folder the command prompt window didn't disappear for several minutes after pressing Enter. As soon as I entered my password the folder reappeared, but it was named Control.Panel....with a string of letters and numbers. So, I was patient, and eventually the command prompt window disappeared and it was properly named 'Locker' again. So, if this happens to you, just hang out a couple of minutes and it should work.

  • Robert Says:

    Works great... I have Windows 10 on HP laptop. I tested this with all file types: text, jpg, gif, png, excel, word, photoshop, etc.. All worked great. IDK what the complaints are about. Maybe different Windows setup?

    Yeah, this won't keep out true tech nerds, but 90% of anyone snooping in your PC won't know where to find this file or even how to edit it.

    If you want more security create a new folder inside your System32 folder named "Registry" then add this BAT file and "Locker" folder inside. No-one will mess with this folder unless conduction forensic investigation on your PC.

  • iscalis Says:

    how to password protect a folder

  • Helios Says:

    It works wonderfully. THANK YOU SO MUCH guysssss so much love from Italy

  • Vinod Says:

    worked wonderfully for me. simple and so effective!

  • Helene Abousamra Says:

    Hello, I cannot re open the file

  • anony Says:

    I know it mentions this at the beginning of the article, but I want to reiterate that this is horribly insecure. Anyone who isn't your grandma can undo this "protection" in mere seconds.

  • jainish Says:

    this is useless as you can get the locked folder by showing hidden files. Useless

  • annoyed person Says:

    doesn't work for me, even run as admin

  • Emilio Says:

    Idk why but you can just edit the fiile format back to txt and then open it with notepad, then youll be able to see the password (in case you forget)

  • Stevekir Says:

    Forget my post of March 16th, 2019 at 8:28 am.

    I get stuck at step 15. I double-clicked Folderlocker.bat but was asked for a password which was rejected (ie., nothing happened. The PW WAS correct. No folder named FolderLocker (without the.bat) appeared. I gave up. Pity.

  • Stevekir Says:

    I need to save image files, so its no use to me.

  • stranger danger Says:

    Wow ! thanks a million! it worked perfectly for me <3 !

  • IAmKINGPush Says:

    How do you hide the text when entering the password?

  • Hemasai Says:

    How to recover password if i forget it

  • RELIAS Says:

    hi ,can i open files inside the locked folder when the folder locked ?

  • Darmo Says:

    This is realy hide the folder with my secret files in it.
    But i still can search on the folder with the .bat file in it by typing a phrase of filename or an extention of the file which is in the lock folder and go search, the file in the lock folder will show up and you can copy paste in the normal folder. If you lost password will be usefull.

  • Iqbal Says:

    Accidentally deleted your FolderLocker.bat?
    - you can just recreate the Locker folder.
    - the new Locker folder created will have your old content.

    A flaw
    - even if you created a new password for the new Locker folder, it works all the same and u can access the same old Locker folder with all its content.
    - whoever wants to access your Locker could just delete and recreate the FolderLocker.bat with their own password and you can also do the same. The cycle continues for eternity

  • Patrick J Says:

    I had the same problem as Adi13 and Paul. I followed all the instructions but I was unable to get the Locker folder to reappear even though there was no PSWD error indicated. I went went through the entire process 3 times or more with the same results every time.

  • Matthew Says:

    Worked perfectly - did you notice the extra character in the file name tab (looks like an "l")?

  • KatKit93 Says:

    If you are worried about someone being able to edit the file, then
    Right click the .bat file
    Click Properties
    Go to the Security tab
    Click Edit beneath the permissions
    Revoke your own username's permission to Write
    Apply this change

    You can still open it by clicking edit, but once you go to save over it, you will no longer have the permission to do so. There is a work around to this as well, but the harder and less obvious you make it to break into your locked folder, the less likely someone is to do it (especially unnoticed).

  • Adi13 Says:

    I used this way but after writing my password ,Locker folder won't appear . I have lots of files transferred in that folder and it's important . What should I do to undo it and get that folder back which I transferred in that Locker folder ,if you know the way ,please tell me via messenger (Facebook) ...
    My full name is Adityaa Mahajan on Facebook. Or mail me -
    adityaa.mahajan13@gmail.com
    Please help me !

  • anton pinkhassov Says:

    Look guys, this is not serious....you can click EDIT batch file and here we go-the password is visible to anyone !!!
    I would refrain from such "security".....lol

  • anton pinkhassov Says:

    Look guys, this is not serious....you can click EDIT batch file and here we go-the password is visible to anyone !!!
    I would refrain from such "security".....lol

  • Sonie Says:

    I forgot my password what to do?

  • Paul Says Says:

    folder disappeared along with its contents, now it will not re-appear. Any suggestions? I verified I am using correct password I put in the code.

  • Lydia Says:

    I noticed that even when entering the wrong password the Locker folder show up... Did anyone else had this problem?

  • Csonka András Says:

    wow! Nagyon köszönöm a segítséget! Nagyon hasznos oldal!

  • Bhudz Says:

    It works, tested it. Hide / unhide folder and it doesn't show up. Checked the bat file with editor, the commands are showing up. I downloaded and converted the file from Bat to Exe. I saved a copy of my exe file to my google drive in case it gets deleted on my local drive.

  • Nic Par Says:

    I'm in IT and this works. If you unhide hidden files and then reclick view hidden files the folder stays hidden

  • wesley223332 Says:

    This does not lock a folder at all, if you have a locked folder, just click View>Hidden items and check the box, the folder will then show up with a line of code and can be accessed.

  • secret Says:

    used this but when i lock it it changes from locker to control panel and a bunch of code in the name but i can still access evrything inside it

  • Mtrot Says:

    I tried it last month and it worked perfectly until yesterday when I unlocked it to use that folder. However, when I tried to lock it again, after entering "y", I got a message that "access was denied" and command window closed before I could read the rest of the text. Tried several times and it continued while the "Locker" folder remained visible. Last night I went through the whole process of creating the bat file again from the start and again it was working when I left it last night. Just came back to my computer and tried successfully to unlock the folder. However, again I am unable to lock it again. I keep getting the message that "Access is denied" along with other text I was unable to read before the window closes again. In my experience, it works on the first few attempts only to stop working (fails to hide folder) thereafter.

  • hajajaja Says:

    Works perfectly, only problem is that if you know how was the content (photos etc) named, you can simply find it in Start and type in the name. Then you press Show location and the whole hidden folder appears without any password...

  • kumar Says:

    People who lost the password. just edit the .bat file and you will find your password after if NOT %pass%==
    in line 45

  • Parzival Says:

    This doesn't lock the folder only hides it I can access my folder by using folder hide/unhide options..

  • LadyEmpress Says:

    Why don't people read? In the article it states that UNLESS the person already knows their way around a computer, this will work.

  • Dariusz Says:

    You're awesome, Thank You very much!, Great article

  • Anand Says:

    Nice article,
    Useful for security reason.
    Always help IT peoples. I am also doing same work but it in Linux.
    Good work

    Cheers,

  • Kryto Says:

    Anyone with a little bit of batch (.bat) knowledge knows you can edit the .bat file.

    That means either changing the password, or worse.. see what you wrote as a password. so if you only use a select few passwords, you have a problem there too.

  • dodgee Says:

    It is working. I tested every possible option.
    1. I checked the option to show hidden folders but the locked folder didnt show up. It's great.
    2. I tried to edit text file to see the password after creating the bat file but text file was empty. Thats nice too.
    3. I tried to edit bat file but i couldnt so that is a good sign too.
    4. But if someone deletes the bat file your locked folder is gone so you will never have access to that folder.

  • mohamed adel Says:

    it just hide the file (locker)
    when I show hidden files, anyone can access what inside it. it has no value for protection. anyway, thanks for your effort.

  • Todd Jones Says:

    It worked perfect for me with all the steps. I created a folder with files and put it into locker folder. When you activate FolderLocker on next click it will ask you do you want to lock folder. Wow!! It went to hidden and clicking on the Folder locker to ask for your password to open folder was amazing.... Thanks so much for sharing because I really need this at work with engineering.

  • Suhail Qureshi Says:

    Its just working. I followed these steps in a folder that has one docs file. This bat file has created a folder. When i protect it, it becom hide. Run bat file and put password. Folder become visible.
    I'm not understanding why people are abusing!!!!!!

  • shameel Says:

    i did create a private folder
    it worked well. but still the items inside are accessable through search. is there anythibg to fix it

  • Ezz-El-Din Abdalla Says:

    YOU THINK YOU SMART ARE YOU?!
    if you click prive file from the win folder you can see the pasword

  • Rachel Says:

    This was useless. Went through all the steps and nothing happened.

  • Muhammad Az-Zu'bi Says:

    Well, I've been using this method exactly as specified, and it's been just great. Suddenly, while trying to access one of my protected folder, it won't open, though I'm 100% sure I'm entering the right password. This is weird and I just do not know what to do!!!

Back to top