Adding a password to a particular file on a Microsoft Windows 10 computer is a common practice. Even though you protect your Windows computer with a password, it’s never a bad idea to add a password to files that hold sensitive information.
The process is not as complicated as it may sound and it will also give you some peace of mind knowing that those essential files have an extra layer of protection. Make sure to bookmark this guide since it will surely come in handy sooner or later.
How to Add a Password to Any Files on Windows 10
The file you want to add a password to doesn’t have to be an already existing file. You can also create a brand new folder that will hold your sensitive information. Once you’ve decided if it’s going to be a new folder or not, open the folder and right-click on an empty space and look for the New option.
When the new window appears, select the option that says Text Document and hit Enter. Don’t worry about the name of the document since you can erase the text files once the password has been created.
Open the file by double-clicking on it and paste the following text in it:
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
How to Add the Password
Look for the part that says ¨Your Password Here¨ and replace it with the password you want the folder to have. Now, click on File and choose Save As. Click on Save as type section that should be automatically placed at .txt. Choose All Files and then name the file FolderLocker.bat.
Once you’ve named the folder, don’t forget to click on Save. Double-click on FolderLocker and the password is now active. Start adding the documents you want to protect into the new Folder Locker folder you just created.
Open the FolderLocker file and in the next screen type the letter Y. Press Enter and the folder should now go away taking whatever you put in it with it.
Now that you’ve completed the task, double-click on the FolderLocker to open it. In the command prompt, type in the password, you created earlier and hit Enter. The FolderLocker folder will now be back along with all your secret files.
Conclusion
Now, even if you leave your computer for a few minutes and someone uses it, you don’t have to fear them seeing any documents you don’t want them to see. You can obviously create as many of these folders as you want to keep your data secure. How many secure folders are you going to make? Leave a comment and let us know.
Travis says
If you right click on the FolderLocker it gives you the option to edit, thus revealing your password.
tammy says
Hi,
Thanks very much for this,
Even though I use windows 10 pro, this seems like a not less good solution,
I too see the hidden map, but I don’t see how it matters if you have a password locking the folder.
frank says
Hi, I tried it; but stil you can see as a hidden map: : Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}
( the option”show hidden files” is always on on my pc)
This is after the “big” windows 10 update. any suggestions ? thnx