How To Folder Lock In Windows 10

Securing sensitive files and folders is essential for protecting your data from unauthorized access. In Windows 10, you can lock a folder with a password for added security. In this blog post, we will guide you through the steps to create a password-protected folder in Windows 10.

Method 1: Using a Batch Script

This method uses a batch script to create a password-protected folder. Follow these steps:

  1. Create a new text document in the desired location.
  2. Open the text document and paste the following code:
title Folder Locker
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 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> 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

Note: Replace <your_password> with your desired password.

  1. Save the file with the extension .bat instead of .txt (e.g., locker.bat).
  2. Double-click the locker.bat file to run the script. It will create a new folder named “Locker.”
  3. Place your files and folders inside the “Locker” folder.
  4. Double-click the locker.bat file again and press “Y” followed by “Enter” to lock the folder.
  5. To unlock the folder, double-click the locker.bat file, enter your password, and press “Enter.”

Method 2: Using a Third-Party Software

Another easy way to lock a folder in Windows 10 is by using third-party software. There are various folder-locking applications available online, such as:

These applications provide a more user-friendly interface with additional features like drag-and-drop and file encryption. Download your preferred software, install it, and follow the on-screen instructions to lock your folders.


Securing your sensitive files and folders with a password is a simple yet effective way to protect your data from unauthorized access. In this blog post, we discussed two methods to lock a folder in Windows 10 – using a batch script and third-party software. Choose the method that suits your needs and keep your information safe.