Password Protect Folders in Windows without using 3rd-party software

Occasionally, Windows users might feel the need to place password protection on their folders. Chances are, these folders contain sensitive information that no one else should view, no matter the reason. There are several third-party free file encryption software available that allow computer users to attach a password to their sensitive folders and encrypt them. However, today we are going to look at how to password protect folders without software. This trick is nothing new – and works even on Windows 10 / 8 / 7.

Password protect folders without software

First thing is first: You will need to create a folder that will contain your password-protected subfolder. Once that new folder is created, navigate inside the folder and create a text document. Now, there is no need to give this text document a unique name because you will be deleting it after everything is done.

Once this new text document is created, just open it and copy paste the following inside:



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


We are almost done here, so don’t go running off just yet.

You will now need to add your required password to gain access to your “sensitive files” whenever you need them. To do this, locate “Your-Password-Here” in the script you just copied and pasted in the text document. Delete “Your-Password-Here” and type in your desired password. Once done, it is time to save the document as “FolderLocker.bat”. This is only possible if “All Files” is selected.

Not sure what that is? Don’t worry, we’ll break it down for you. Within the document, click on File, and then Save as. After that, you should see something called Save as type, click the drop down menu and choose All files. Once done, save the document as FolderLocker.bat and close it.

You should now see a file with the name, “FolderLocker”. Double click on it and it should automatically create a folder called Private, this is where you will be storing all your sensitive data. Open it and place your files inside, when you’re done, return to the file called FolderLocker and double-click it. You should see the following:

Password protect folders without software

Type “Y” and press Enter. This will lock the Private folder, which will force it to disappear. If you would like to see it again, double-click FolderLocker again, but this time you’ll need to type the password you have chosen. Next, press Enter.

That’s it; you’ve done well, so pat yourself on the back. You can now safely store your sensitive files in a password-protected folder without using a third party software.

We suggest that you first try using this trick on empty folders, till you get a hang of it. Don’t go on and password-protect your important data right away. Once you get the hang of it, you can go on and use it on your important folders. Also if you were to forget your password, simply right-click the FolderLocker.bat file and select Edit. You will be able to see the password there.


Here is a list of links to posts that will show you how to password protect documents, files, folders, programs, etc in Windows.

Posted by on , in Category Windows with Tags
Vamien McKalin possesses the awesome power of walking on water like a boss. He's also a person who enjoys writing about technology, comics, video games, and anything related to the geek world.


  1. myr4ik07

    ????, ?????

  2. Foze RI

    *Hide Folders in Windows without using 3rd-party software

  3. dypsis

    Very good.
    Thank you.

  4. tim

    Hello everyody,
    I have a Problem, because I have forgotten my Password. Is there any possiblity get access to the files?
    That would be very important for me.
    Thank you very much in advance.
    Best regards,

  5. DutchPete

    Read the text in italics at the end !!

  6. DutchPete

    I don’t see the use of this if anyone can access the password by right-clicking the FolderLocker.bat file. Or am I missing something??

  7. Juan Figueroa

    Some programs can see the files or folders even if they are hide, for example burning software.

  8. Andrey

    Sorry, but this method is unsafe and inefficient.. For best security, in Windows 7 and above I suggest:

    Create a VHD image file (Virtual Hard Disk).
    Mount it (left click). Will add a new drive on your computer.
    Format it and enable bitlocker. (You must do so only once).

    Now you can connect and disconnect this virtual disk file. Each time you connect it to use again, a password is requested.

    To disconnect, simply click the right button on the drive.

  9. DutchPete

    Alternative with similar approach (virtual drive) but a bit simpler: VeraCrypt.

  10. Andrey

    I proposed bitlocker is why it is native, without using 3rd party software. But VeraCrypt is a great alternative as well.

  11. DutchPete

    I understand. I am not too familiar with BL but have the impression it is a bit difficult to manage. That is probably an ignoramus’s view though 🙂

  12. DutchPete

    I posted a reply yesterday but it does not seem to have got through.
    The reason I reacted to BitLocker is because my impression is it is more difficult to manage, but that is perhaps I ma not very familiar with it. Call me ignorant 🙂

  13. There is nothing in the Disqus moderation queue too. Maybe you want to post the comment again?

  14. Andrey

    On first time may seem a bit complicated. But following the steps I mentioned above briefly, is quite simple.

    – Creating a VHD image file (Virtual Hard Disk) and Mounting it –
    – To mount/umount drive with right-click in Windows 7 (in WIndows 8 is native) –
    -Enabling BitLocker –

    However, the biggest advantage of VeraCrypt for me is that it is cross platform. For those who work with multiple operating systems, like me, he is the most recommended option as it works on Windows, Linux or OSX. 🙂

  15. Tomfin

    Also if you were to forget your password, simply right-click the FolderLocker.bat file and select Edit. You will be able to see the password there.

  16. Jake

    Whenever I type ‘Y” after clicking on FolderLocker, the only thing that happens is a file is generated that is titled the letter O with an umlaut. Any idea why this happens?

  17. Shannon Barill

    Which makes me wonder how this is secure in any kind of way? lol That was the first thing I thought about upon reading this article… Anyone can open the .bat file and read the password.

  18. eimaizwoo2

    what does this method do to the folder? i mean its not hidden because i have enabled the option to see hidden folders and i cant see it?

  19. Zia Ansari

    Actually I just forget to enter my password and it has locked my folder and disappeared my folder kindly help me out please…..!

  20. Hlanganiso Maluleke

    How do I undo all of this?

  21. NG

    ZIP (archive) the .bat file with a password. the .bat file runs from winzip file explorer. better than archiving the entire folder with the password because it is difficult to run some files in archive state which is not an issue with this .bat file. I just tried and I am surprised,

  22. Daya Kishan Joshi

    I second DutchPete. “I don’t see the use of this if anyone can access the password by right-clicking the FolderLocker.bat file. Or am I missing something??”

  23. Qasim Sarfraz

    Have you got your answer ? Because I am also having a same problem.
    Help me if you figure it out.

  24. ObamaO

    i dont get the use of this, after i click y to lock the folder, it only makes the folder turn less brighter not even hiding it which still can be seen clearly and when double click into the lock folder, nothing changes inside.

  25. Kelda Sinclair

    This seems to be a new issue. I have been using this method for years. But only after my windows 10 update yesterday did I start having the same issue as you.

  26. David

    this is not working …I mean to say that if you will enable view hidden files then the file wont ask any password and it is directly accessible… I dont understand what is the use of putting password if you need to hide your files from setting (dont show hidden files and folders). If I would be a intruder in a pc then first thing I will do is activate show hidden files and folders… still you guys need to think… 😛

  27. Marcus Cassidy

    Its rubbish I tested it on some pictures and all it did was grey out the folder that i had locked but then all you need to do is click on the folder and it opens anyway showing all the pictures inside so its totally useless

  28. Kevin Laboski

    The .bat file is a copy of the text file where you have entered your password, so if someone clicks edit and just searches it it will see your password.

  29. Anna

    I can simply delete the FolderLocker.bat file and the folder automatically becomes accessible, am I doing something wrong here?

  30. Caomc

    I think people are misunderstanding the point of this method. (Author included)

    If you want to protect important your files and make them secure you should encrypt them.

    If you want to bury some “personal” files so that no one just comes across them of your computer, this’ll do. I just throw this into a program install directory and anyone who isn’t a programmer isn’t going to be suspicious of a file called “script.bat” in a folder surrounded by script files.

    You don’t have to call the file “FolderLocker.bat”.

  31. Cecil Rhodes III

    Ive been through this 5 times all it does is change the name of the folder it still opens without password

  32. Claire Davidson

    You have options enables in explorere to view system files and view hidden files. Disabling those will hide the files again. I always leave mine to visible. This “Locker” does not lock, it just hides.

  33. Claire Davidson

    I “locked” mine with this method. Then within 30 seconds, and without using the file again to unlock it, I had opened it and made it fully visible again. This method will ONLY PROTECT YOU FROM PEOPLE WHO ARE NOT PC SAVVY. I promise you, any half decent PC user with a knowledge of Explorer view settings and the “Attrib” command will have all of your “secure” data fully available within seconds.

  34. Jason

    When I enter Y to lock the private folder with files in it, I get an access denied message in the cmd terminal, but it works just fine when the private folder is empty. Please help, not really useful if i cant lock it…

  35. Bilalzzz


  36. Jonah Madeya

    Don’t sweat, you can still access those files with most softwares (filezilla…) and open/copy/move them. if you want to encrypt, compress with password. if you just want to hide from the beta user, right-click > properties > check hidden, then show/hide them from the Folder Options in Control Panel.

  37. alex

    There is a problem. When the preview pane is open and you single click to highlight the folderlocker file it shows the code and therefore the password!

    Is there any way to stop this?

Leave a Reply

Your email address will not be published. Required fields are marked *

2 + 9 =