Password protecting your folders and files in Windows is the best way to make sure nobody will gain unauthorized access. In Windows 10, you can tuck those secret plans or files in a secret folder which is password protected, and you are able to do it without buying any extra software. There are two methods to password protect a folder in Windows.

So here are the two methods below, to passowrd protect Windows files/folder, let's take a look on them one by one:

How to Lock the Folder with a Password in Windows

1 First, you have to right click inside the folder where the other files are located which you want to protect.

how to password protect a folder mac

2 Now select New from the menu and click on the Text Document.

3 Open the text document file by double click or simple press by entering.

4 In this new document, you have to paste a coding or program which is below. So just copy and paste it:



title My Folder

if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK



echo Are you sure you 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 Secure "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"

attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"

echo Folder locked

goto End


echo Enter the Password to unlock folder

set/p "pass=>"

if NOT %pass%== Password-Here goto FAIL

attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"

ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Secure

echo Folder Unlocked successfully

goto End


echo Invalid password

goto end


md Secure

echo Secure created successfully

goto End


5 Now find where “Password-Here” is written in the document

6 Replace the “password-Here” with your own password by which you want to lock the folder.

7 Click on the file and select the save as option.

8 Now click on the “Text Document (*.txt)” to open the drop-down menu and choose All Files.

9 Rename the file as you want i.e. “Locker.bat” and clicking on the save option.

10 Now double click on the locker file and there will be a locker folder will generate with the name Secure.

11 Move the files and folder in the Secure folder which you want to protect or locked.

12 Click on the Locker file.

13 Type Y here to lock the folder and click enter. The Secure folder will disappear and your files will safe and locked.

14 To unlock the Secure folder, just double-click on the Locker file and enter the password. Press enter and the Secure folder will appear.

Using Windows Built-in Encryption to Password Protect a Folder

1 Right-click on the folder which you want to protect.

2 Select the Properties in the menu.

how to password protect a folder in windows 8 without software

3 Now in the General Tab, you can see the Advanced option. Click on it.

how to password protect a folder in windows 10

4 Here you have to tick on the option “Encrypt contents to Secure data” and click the option Ok.

How to Password Protect a Folder in Windows?

Note: If the "Encrypt contents to secure data" option is not available or you are not able to tick this option then you have the Windows home edition version which will do not support this feature.

So, that’s how you can password protect a folder in Windows. 

You may also like to read:

How To Add Another Face To Face ID On iPhone?

How To Uninstall Programs On Windows 7

Split Screen using Snap Layouts in Windows 11

Enable - Disable Mouse Acceleration in Windows 11

How to view and reset network data usage in Windows 10/11