How to Password Protect a Folder on Windows 10 [2024]

Written By Shubrato Dev Baishnab

If you use a shared PC, locking a folder that contains important files is obvious. It also helps you from accidental deletion by others and keeps everyone’s privacy intact. So, how to do that?

password-protect-folder-windows-10

Well, this article shows the two quickest ways to lock a folder with a password on your Windows 10. Read along.

How to Protect a Folder With Password on Windows 10

To lock a folder with a password on Windows 10, you can encrypt the folder. To do that, right-click on the folder and select Properties. Then click on the Advanced button and check the box of Encrypt contents to secure data. Besides you can also use Windows commands to protect a folder with passwords.

Now, let’s see the steps of these methods to protect a folder with a password.

1. Encrypt a Folder with Password Protection

There is no such built-in folder-locking app on Windows 10 OS. Instead, you can encrypt a folder with a password.

  • Right-click on the folder.
  • Select Properties from the context menu.click-properties
  • Click on the Advanced button.click-advanced
  • Tick mark the box of Encrypt contents to secure data option.
  • Click the OK button.tick-mark-ecrypt-contents-to-secure-data-option

Now, you’ll see a prompt to back up your file encryption certificate and key.

  • Select the Back up now (recommended) option from the backup key prompted window.select-back-up-now
  • Click Next > Next from the Certificate export wizard window.click-next
  • Tick mark the Password option to apply the password for the encrypted folder.
  • Type in the password in the Password & Confirm password field.
  • Click the Next button after that.enter-password-to-encrypt-floder-on-windows-10
  • Give the file a name and browser for the location.
  • Select the Save button to save the PFX file.give-file-name-and-click-save
  • Click on the Next button to see the review information.save-and-click-next
  • Hit the Finish button to complete the folder encrypting process.

Then click on the OK button from the successful exporting prompt.select-finish-button

2. Use Windows Command to Password Protect a Folder

If you don’t like encrypting the folder, you can lock it with the Windows batch command. In that case, you must create a new text file inside the folder you want to lock. Then copy the batch command lines into that, and save the file with .bat extension.

That command file will lock and unlock the folder whenever you want. For detailed procedures, follow these steps:

  • Go inside the folder where the files are.
  • Right-click and select New > Text Document.create-new-text-document
  • Double-click the newly created text file to open it.
  • Copy & paste the below command lines into the text file.

 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

  • Find the marked line that says “Your-Password-Here”.
  • Replace the line by typing in the password that you want to lock with.set-password

Important Note: Before entering the password, note down the password somewhere safe. If you forget the password, you have nothing but forget the files!

  • Click on File > Save as.select-save-as
  • Rename the file from the File name field.
  • Type .bat in the last of the file name. For example, “Important Folder Locker.bat”.
  • Click the drop-down icon of the Save as type field and select All Files.
  • Hit the Save button.rename-file-and-click-save
  • Double-click on the newly created .bat file, and the Locker folder will appear.locker-folder-created
  • Move all the essential files you want to lock into the Locker folder.
  • Double-click the .bat file again to initiate the locking process.

Now, a command console will appear to confirm the folder-locking process.

  • Enter Y to ensure the folder locking, and hit Enter.enter-y-from-keyboard

After that, the command console will close, and the Locker folder will disappear. If you want to unlock the folder:

  • Double-click the .bat file, and a command console will open.
  • Enter the password that you have given in the command batch file.
  • Hit Enter afterward.enter-password-to-bring-back-the-folder

The Locker folder will appear again. To lock the folder again, repeat the same steps. Moreover, you can apply the same methods if you want to lock a folder in your Windows 11. Even if you want to lock a drive instead of the folder only, you can do that too.

How to Protect a Drive With Password on Windows 10

You can lock or protect a drive with a password by turning on the BitLocker Drive Encryption feature from the Control Panel. So, right-click on the drive and select Turn on BitLocker. Check the box to use a password to unlock the drive. Then set the password and save the backup recovery key. Go through this detailed version:

  • Right-click on the drive that you want to lock with BitLocker.
  • Select the Turn on BitLock option from the context menu.click-turn-on-bitlocker
  • Check the box for Use a password to unlock the drive option.
  • Type in the password and re-enter it for confirmation.
  • Click the Next button.enter-password-for-bitlocker-and-click-next
  • Choose the Save to a file option to save the BitLocker recovery key.click-save-to-a-file-option

You can select the first option to save the recovery key to the Microsoft account. So, when you forget the password, you can use the recovery key by going to your Microsoft account.

But I’ll recommend you save the recovery key to the local drive, which is the second option. So that you make a copy and save it anywhere you want.

  • Browse the saving location and click Save > Yes.
  • Click the Next button again.
  • Select the Encrypt entire drive option and click Next.select-lock-entire-drive-with-bitlocker-option
  • Choose the New encryption mode and hit the Next button.

However, you can select the Compatible mode if you want.

  • Click on the Start encrypting button to start the drive locking process.click-start-encrypting-button

Note: You must save the BitLocker recovery key to a removable drive. Otherwise, you can’t save it.

An encrypting progress status window will appear. You can click the Pause button to pause the encryption process or let it continue. Once the process is completed, select the Close button to close the window.

After that, restart the PC and go to File Explorer, and you’ll see a yellow color lock icon beside the drive icon. Which indicates the drive is locked. So, when trying to access the drive, a prompt will appear asking you to enter the unlocking drive password.lock-a-folder-with-bitlocker

Enter the password and click the Unlock button. The drive will be unclocked, and all the files and folders inside it will be available for access.enter-password-to-unlock-folder

Pro Tip: If you forgot the password for BitLocker, click on the More options under the password field. Select the Enter recovery key option, enter the 48-digit recovery key, and click the Unlock button.

You can also tick mark another option which is Automatically unlock on this PC option if you want to lock a removable drive with the BitLocker. However, if want to turn off the BitLocker:

  • Unlock the locked drive first and right-click on it.
  • Choose the Manage the BitLocker option.click-manage-bitlocker
  • Select the locked drive and click on the Turn off BitLocker option from the right.

You can also select the Change password, Remove password, or Back up your recovery key options.manage-bitlocker-options

Why Can’t I Password Protect a Folder?

If you’re using Windows 10’s built-in BitLocker feature to lock the entire drive, you won’t be able to lock only a folder. Plus, unauthorized access protection in the device might not support locking a folder in the drive. So, these are the main reasons that you can’t lock a folder on Windows 10.

Now let’s explore the reasons in detail.

1. Enabled BitLocker

If you already enabled BitLocker to lock & encrypt the entire drive with a password, you might not lock only a folder inside that drive. The fact is when you encrypt a drive, locking anything inside it won’t be possible.

2. Unauthorized Access Protection

Windows 10 OS comes with an unauthorized access protection feature and can secure the PC from redundant access. So, if this is turned on, locking a folder won’t work.

3. Bugs in the OS

Bugs or glitches in the OS are common things that can alter anything within the system. If you’re unable to lock a folder when BitLocker isn’t turned on or other protection isn’t blocking the locking folders, bugs might be the culprit.

So, due to the above facts, you can’t protect a folder with a password on your Windows 10. Similarly, you can’t turn on BitLocker in Windows 10 Home version. But there are alternative ways to turn on BitLocker in Windows 10 Home.

Frequently Asked Questions

Why can’t I put a password on a folder in Windows 10?

If you can’t protect a folder with a password on Windows 10, the BitLocker might be turned on. However, Windows 10 don’t have any specific folder locker app, but the Microsoft account already comes with unauthorized access protection, which could be a reason too.

What does encrypting a folder do?

Once you encrypt a file, document, or folder, no one can decrypt it without the decryption key. Decryption is like a password; without it, it’s meaningless to have encrypted files or folders.

Bottom Line

Now you know how to lock your important folder in Windows 10 with a password. So none can see your personal files or important documents without your permission from now on.

However, if you need further help regarding Windows OS, go through our website or comment below.

About The Author
Shubrato is a tech enthusiast and avid writer with a passion for technology-related things. He earned his undergrad degree in CSE. An experienced writer about the latest gadgets & software. He knows how to explain complex concepts clearly and concisely. You’ll find him tinkering with new tech or playing the latest video games when he isn’t writing.

Leave a Comment