You are currently viewing Password Protecting Folders in Windows 10

Password Protecting Folders in Windows 10

I’ve been looking around at ways to password protect folders on my machine without software and I found out that Windows 10 has features that allow for this. I thought it would be worth sharing this really cool way of protecting personal files on your Windows 10 machine with all our followers.

Follow these steps and you’ll be securing you personal folders in no time.
  1. Open the folder you would like to password protect
2. Right-click inside the folder and navigate to NEW -> TEXT DOCUMENT
3.Open the text document and enter the following text
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

5. Change the following within the text to your desired password: Your-Password-Here
6. Once you have set the password, click FILE -> SAVE AS and then as the image below shows, change the ‘Save as type:’ to ALL FILES and name the file: FolderLock.bat
7. Double-click on FolderLock and a folder called: Folder should appear as shown in the second image below
8. Move all you files/folders you want password protecting into the Locker folder
9. Once you are happy with everything inside the Locker folder it is time to lock the folder. Double-click on the FolderLock file and you will be asked to confirm you want to lock the folder
Wolah…your folder is now locked and the only way to unlock this is to double-click on the FolderLock file where you will be asked to enter the password set for that specific file.
I found this to be a good semi-secure method of hiding your folders however, after some testing I found it is not 100% bullet proof. With the correct software an unauthorized user could unlock your folder by gaining access to your password, the screenshot below shows how I did it on a test folder.
Using Notepad++ I was able to open the FolderLock file and expose the password…YES it was that simple. So although this method could be used if you find yourself forgetting your password, it can also be used if a bad actor has access to your device already. With that in mind it is probably worth setting the folder passwords to something other than the ones you use for your main accounts on a daily basis.
And for those that were thinking about applying this method to multiple folders, you’ll be pleased to know that you can do this by using the same method. You can also use different passwords for each folder should you wish.


Kelvin is a Cyber Security professional with years and experience working with organisations in different verticals, both large and small. He enjoys contributing to the Network Wizkid knowledge base and he also creates technical content. Kelvin enjoys learning new things and often does this by working on achieving new technical certifications. He holds many professional certifications and academically, he has achieved a Bachelors and Master's degree in both Computer Networks and Cyber Security.

Leave a Reply