Short answer: you can’t password-protect a folder on Windows the way you’d lock a zip file. There’s no “add a password” option anywhere in File Explorer. The closest built-in option is a small virtual drive locked with BitLocker: a single file that opens as a drive when you type the password and locks again when you eject it. It works only on Windows 11 Pro, Enterprise and Education.
On Windows 11 Home, your Windows sign-in is the lock, and there are a couple of honest ways to make it stronger. What doesn’t work is the “folder locker” batch file found all over the web. More on that below.
First, check which Windows you have
Open Settings → System → About and look at Edition under Windows specifications. If it says Pro, Enterprise or Education, use the first method. If it says Home, skip to the Home section.
How to password-protect a folder on Windows 11 Pro
This creates a “vault”: a file such as Vault.vhdx that behaves like a USB drive. Inside it, BitLocker encrypts everything, and nothing can be read without the password. Setting it up takes about ten minutes.
- Open Disk Management. Right-click the Start button and choose Disk Management.
- Create the virtual drive. Click Action → Create VHD. Choose Browse, pick a folder and type a name such as Vault. Set a size a little bigger than the files you’ll keep (10 GB is plenty for documents), choose VHDX and Dynamically expanding, then click OK.
- Initialise it. A new disk appears at the bottom marked Not Initialized. Right-click its name, choose Initialize Disk, keep GPT and click OK.
- Format it. Right-click the Unallocated space next to it, choose New Simple Volume and click Next through the wizard. Give it a drive letter and the volume label Vault, keep NTFS, and click Finish.
- Turn on BitLocker. In File Explorer, right-click the new Vault drive, choose Show more options → Turn on BitLocker, then tick Use a password to unlock the drive and type a strong password.
- Save the recovery key. Choose to save it to your Microsoft account, to a file or to paper. Don’t save it inside the vault itself.
- Start encryption. For a new, empty drive, Encrypt used disk space only is fine. Pick Compatible mode if you might open the vault on an older PC; otherwise choose New encryption mode. Click Start encrypting.
- Lock and unlock it. To lock the vault, right-click the drive in File Explorer and choose Eject. To open it again, double-click the
.vhdxfile to mount it, open the drive and type your password.
Ejecting is what locks it. If you leave the drive mounted and unlocked, anyone using your signed-in PC can open it, just like an unlocked USB stick.
The other Pro option: encrypt a folder with EFS
Windows Pro also has EFS, the Encrypting File System. It’s quicker, but it isn’t a password in the usual sense.
- Right-click the folder, choose Properties, then click Advanced on the General tab.
- Tick Encrypt contents to secure data, click OK, then Apply. Choose to apply it to the folder, subfolders and files.
- When Windows offers to Back up your file encryption key, do it, and keep the backup on a USB stick or in a safe place.
EFS ties the encryption to your Windows account. You don’t type a separate password; the files open automatically whenever you’re signed in. It stops other user accounts on the PC, and anyone who removes the drive, from reading them. It doesn’t stop someone who sits down at your unlocked PC. If the tick box is greyed out, you’re on Windows Home, or the drive isn’t formatted as NTFS.
What can you do on Windows 11 Home?
Home has neither BitLocker drive encryption nor EFS. Microsoft says BitLocker Drive Encryption is available on Pro, Enterprise and Education only. Home gets a simpler feature, Device Encryption, which encrypts the whole drive automatically. That protects your files if the laptop is stolen, but it does nothing to stop other people who use the same PC.
Three honest options:
- Give everyone their own account. Go to Settings → Accounts → Other users → Add account and make the new accounts Standard, not Administrator. Standard users can’t open your user folders, and with Device Encryption on, your account password becomes the real lock.
- Use OneDrive’s Personal Vault. OneDrive is built into Windows, and its Personal Vault folder needs a second check, such as a code or your fingerprint, before it opens. It locks itself after a short period of inactivity, and on a Windows PC the synced copies sit in a BitLocker-encrypted area of the drive. The catch: on the free or 100 GB OneDrive plans it holds only three files. Microsoft 365 Personal and Family remove that limit.
- Upgrade to Pro. If you need a real password-locked vault on one PC, upgrading unlocks both methods above.
If extra software is acceptable after all, a free archiver such as 7-Zip can create an encrypted, password-protected archive. That’s the usual recommendation for Home users who want a true per-folder password.
Why the “folder locker” batch file doesn’t protect anything
Many guides suggest pasting a script into Notepad and saving it as locker.bat. It renames your folder and marks it hidden and protected. That’s all. The files aren’t encrypted. The password is stored as plain text inside the script, which anyone can open in Notepad. And anyone who turns on hidden files can browse straight in. Technobezz sums it up: these tricks change what’s visible without encrypting anything.
Common mistakes
- Losing the recovery key. Without it, a forgotten BitLocker password means the files are gone for good.
- Leaving the vault mounted. An unlocked vault is an open folder. Eject it when you’re done.
- Copying EFS files to a USB stick or zipping them. If the destination doesn’t support EFS, such as a FAT32 or exFAT stick, or a zip archive, the copy comes out unencrypted. Windows usually warns you first; read the warning.
Once your private files are locked away, you can tidy the rest automatically with our guide to organising files on your PC with zero coding. For files you keep in the cloud, our Google Drive vs OneDrive vs Dropbox comparison covers how each one protects them.
FAQ
What happens if I forget the password?
For a BitLocker virtual drive, you can unlock it with the 48-digit recovery key you saved when you set it up. Without the password or the recovery key, the files can't be recovered. That's the point of encryption, so save the key somewhere other than the locked drive.
Can I put the virtual drive file in OneDrive or on a USB stick?
Yes. The .vhdx file is just a file, and it stays encrypted wherever you copy it. Eject the drive before you copy or sync it, so you're not copying it halfway through a change.
SOURCES
- Microsoft Support: Device Encryption in Windows
- Windows Central: How to protect a folder with a password on Windows 11
- Geek Rewind: Password-protect a folder in Windows 11 without third-party software
- Cocosenor: Create an encrypted container file with BitLocker
- EdUHK: Protect sensitive data with a BitLocker virtual hard disk
- Windows Central: How to use EFS encryption
- Tom's Guide: How to encrypt files on Windows
- ElevenForum: Encrypt or decrypt files and folders with EFS in Windows 11
- Technobezz: How to password protect a folder in Windows
- Microsoft 365 blog: Personal Vault available worldwide
- Office Watch: OneDrive Personal Vault explained
- VentureBeat: Microsoft announces OneDrive Personal Vault



