How to Lock a Folder in Windows 10 Without Software
To lock a folder on Windows 10 natively, right-click the folder, select Properties, click Advanced, and check Encrypt contents to secure data. Note that this feature (EFS) is tied to your Windows user account and is only available in Windows 10 Pro, Enterprise, and Education editions. Home edition users must use a CMD batch script workaround or third-party folder lock software.
Whether you share a PC with family members or use a laptop for work, keeping sensitive documents, financial records, or private photos hidden from prying eyes is essential. Unfortunately, Windows 10 doesn't offer a simple "right-click and add password" option for individual folders.
However, you do have options. Depending on your version of Windows 10 and your comfort level with technical settings, you can secure your folders using built-in encryption, command-line scripts, or dedicated security applications. This guide covers all the reliable methods.
Method 1: Built-in Folder Locking (EFS)
Windows 10 Pro and Enterprise editions include the Encrypting File System (EFS). This is the official, native way to "lock" a folder. It works by tying the encryption to your specific Windows user account. If someone else logs into the computer with a different account, they will not be able to open the files.
Step-by-Step Instructions:
- Locate the folder you want to protect in File Explorer.
- Right-click the folder and select Properties.
- In the General tab, click the Advanced button.
- Check the box that says Encrypt contents to secure data.
- Click OK, then click Apply on the main Properties window.
- Windows will ask if you want to encrypt just the folder or the folder, subfolders, and files. Choose Apply changes to this folder, subfolders and files and click OK.
You'll notice a small lock icon appear on the folder icon. It's crucial to understand that you won't be prompted for a password when you open the folder. The protection works transparently in the background for your user session. However, it's highly recommended to back up your encryption key when Windows prompts you, as losing access to your user account means losing access to these files permanently.

Method 2: Lock Folder Without Software Using CMD

If you are using Windows 10 Home (which lacks EFS) and want to lock a folder without installing any third-party tools, you can use a classic batch file script. This method doesn't technically encrypt the files; rather, it hides the folder and requires a password to unhide it via the command prompt.
How to create the CMD lock:
- Create a new folder where you want to store your hidden files.
- Open Notepad.
- Copy and paste the exact code block below into Notepad.
cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private 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 Private "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}" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End- Find the line that says
YOUR_PASSWORD_HEREand replace it with your desired password. Leave the spaces before and after. - Go to File > Save As.
- Change "Save as type" to All Files (*.*).
- Name the file
locker.batand save it in your initial folder. - Double-click
locker.bat. A new folder named "Private" will appear. - Move your sensitive files into the "Private" folder.
- Double-click
locker.batagain. A command window will ask if you're sure. Type Y and press Enter. The "Private" folder will vanish. - To access it again, run the batch file and enter your password.
Troubleshooting & Common Mistakes
Native methods can be finicky. Here are the most common issues users run into when trying to lock folders manually on Windows 10.
| Problem | Common Cause | Solution |
|---|---|---|
| "Encrypt contents" is grayed out | You are using Windows 10 Home Edition. | EFS is not supported on Home. Use the CMD method or a software alternative. |
| CMD locked folder is visible | "Show hidden operating system files" is checked in Folder Options. | The CMD method relies on hiding attributes. Uncheck this setting, or use real encryption. |
| Lost EFS encryption key | Windows profile corrupted or OS reinstalled without key backup. | Files are permanently lost. Always export your EFS certificate when prompted. |
Windows 10 passed its October 2025 support milestone, so this is also a good time to think about how your protected data will move with you. Account-bound encryption and simple hiding tricks can be awkward during a PC migration; a separate encrypted container can be easier to carry forward when you change devices.
