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.

Download this VPN to secure all your Windows devices and browse anonymously
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.