Occasionally, Windows 11/10 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 11/10.
Password protect folders without software on PC
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:
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
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 into 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:
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 third-party software.
Related: How to Lock a File or Folder in Windows
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.
????, ?????
*Hide Folders in Windows without using 3rd-party software
Very good.
Thank you.
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,
Tim
Read the text in italics at the end !!
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??
Some programs can see the files or folders even if they are hide, for example burning software.
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.
Alternative with similar approach (virtual drive) but a bit simpler: VeraCrypt.
I proposed bitlocker is why it is native, without using 3rd party software. But VeraCrypt is a great alternative as well.
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 :-)
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 :-)
There is nothing in the Disqus moderation queue too. Maybe you want to post the comment again?
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 – https://www.thewindowsclub.com/create-use-virtual-hard-disk-files-as-real-hard-disks-in-windows-7
– To mount/umount drive with right-click in Windows 7 (in WIndows 8 is native) – https://www.thewindowsclub.com/add-attach-detach-option-to-context-menu-of-vhd-files
-Enabling BitLocker – https://www.thewindowsclub.com/bitlocker-feature-windows
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. :)
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.
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?
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.
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?
Actually I just forget to enter my password and it has locked my folder and disappeared my folder kindly help me out please…..!
How do I undo all of this?
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,
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??”
Have you got your answer ? Because I am also having a same problem.
Help me if you figure it out.
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.
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.
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… :P
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
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.
I can simply delete the FolderLocker.bat file and the folder automatically becomes accessible, am I doing something wrong here?
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”.
Ive been through this 5 times all it does is change the name of the folder it still opens without password
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.
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.
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…
NOT WORKING ??? I HAVE TRIED THAT FEW TIMES BUT STILL WHEN I DOUBLE CLICK MY LOCKED OR PRIVATE FOLDER , IT OPENS AND I CAN SEE MY PRIVATE DOCS WHICH I WANT TO HIDE OR LOCK !!!
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.
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?