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

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,
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
155 comments
  • AJIT CHOURASHIYA Says:

    PLEASE TELL ME HOW I PROTECT FOLDER IN LOCAL DISK'E'

  • 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
    :UNLOCK
    if NOT %pass%==Your-Password-Here goto FAIL

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

    save

    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?

    Thanks

  • Himanshu Says:

    is this process will work in windows 7 pro & 8 or 8.1 etc

  • James Says:

    On what I thought would be an interesting learning to apply the step-by-step instruction, it turn out to be a useless, frustrating exercise. There were always error feedback on its execution. On the first place, this program does not seem to have the endorsement of Microsoft. A waste of time, really!

  • Garmagikalio Says:

    Thanks you! I needed it!
    it work for me on windows 10 Pro

  • Ayanle mohamed hassan Says:

    i used this code, several times,i have a problem in step 18, when i enter "y" to lock the folder another folder is created, instead, and replaced the locker folder, and if I open it all the contents are there. can you help me please. am using window 10 home.

  • Puchu Says:

    Good one .Thanks Man !! It worked !!!

  • kumaraswami kondaveeti Says:

    i did the process as you say but the locker folder opened with out asking any password. is not working for my laptop.

  • anya999 Says:

    a good one. but it only hides the folders from direct view. if someone is searching for your folders, they'll have no problem finding them by typing in the search bar.

  • don0833 Says:

    not working for me. when i lock the folder, the locker folder will change its name to control panel and can still be open.

  • ShadySal Says:

    You can edit the bat file with any text editor and change the password even while its "locked" so anyone can open it and see your password or edit it.

    So do not keep the bat file in the same location only when you want to lock or unlock just like a key.

  • Quang Says:

    You can just delete the FolderLocker file, or put it somewhere else.
    You only need it to be in the folder when you want to lock or unlock.
    As long as you remember the same password, you can always make that file anytime following Henry's instruction.

  • unknown Says:

    I keep a lock folder with password and has the password to the folder in it.

  • Hossein Says:

    Hey
    There is a bug with it!
    If someone chooses " Preview pane" in view title bar, he/she can overview the content in folder locker.bat
    so he/she can find the password!

  • sachin Says:

    what if i accidently deleted thefolder "New Text Document",
    permanently?

  • Ravi kiran Says:

    Awesome............ it works
    use it properly and make sure of your password and don't blame guys............

  • Rudi Rudolph Says:

    Unless I have done something wrong, Right click on the bat file, select edit and you will see what the password is. Does not work for me.

  • weedy Says:

    if u lost work like me just type the title of the work into the search

  • Surya Says:

    Don't use it.
    It's totally fraud.Even though I'm typing the correct password my files are not displayed.
    I lost my valuable files due to this.
    don't dare to do this.

  • Ahsan Says:

    It just hides the files.
    More over anyone can get the password by editing the folderlock file with notepad or anything and look for pass==

  • Vedansh Barthwal Says:

    It is just for hiding the folder. The folder appears when you search on search bar. Not Useful.

  • Ayush Maurya Says:

    if we forgot password then how can we recover it.

    i am typing correct password,but the locker password doesn`nt open.

    please help immedatley

  • Sandra Styskin Says:

    Interesting idea, however the protection provided by this method is extremely limited. Simply enabling "show hidden/system files" will make the files appear again, completely bypassing the password protection in literally a few clicks. Even worse, if you do this for files on a portable device, say a USB stick, and connect it to a computer that has the option "show hidden files" enabled, the files will show up right away! So it's not really a great solution if you want to give a USB stick to a friend and be sure he doesn't see your hidden files.

    Properly password protecting files without additional software is a feature that Windows simply doesn’t have, so the only way to actually password protect your files is to use additional software. If you are looking for an easy-to-use solution, I would suggest Safeplicity (https://www.safeplicity.com), but I am biased, so don’t take my word for it and be sure to check out some alternatives. If you’re looking for a free open-source solution, VeraCrypt (https://veracrypt.codeplex.com/) is probably the best.

    One last word of caution: when choosing the software, make sure that it not only password protects your files, but also encrypts them. Password protection without encryption (like the one suggested in the article) can be bypassed by any computer-savvy person with ease – we have seen many lives ruined because of this. Password protection with encryption cannot be broken by anyone (unless you believe in conspiracy theories).

    Finally, for everyone who cannot access their data anymore, here are detailed instructions how to get it back: Simply go in Windows Explorer to Options -> Change folder and search options. Now make sure you tick: “Show hidden files”. Also un-tick “Hide protected operating system files”. That’s it. Your “protected” folder will show up again with the name “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}”.

  • UltraUnknown Says:

    Hi. Basically noticed a flaw in this. I was editing my own version of this, and noticed it can be viewed via 7-ZIP. Even if you have converted batch to exe, 7-zip can still see the "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} " folder and that folder is the locker. Within the folder with 7zip, you can still access it's internals.

Back to top