You cannot truly password protect a folder in Windows without extra software, unless you have Windows Pro or higher. On Pro, the closest real option is a small virtual drive encrypted with BitLocker, which asks for a password every time you attach it. EFS encryption (also Pro only) protects folders from other accounts, but does not ask for a password. On Windows Home, the built-in tricks people share online, such as "locker" batch files and hidden folders, only hide the folder: the files are not encrypted and the password can be read in Notepad.
This guide goes through every method that needs no download, explains exactly how secure each one is, and shows the one that actually works.
The folder locker batch file: why it is not safe
A popular tip is to paste a script into Notepad, save it as a .bat file, and run it to "lock" a folder with a password. Here is what the script really does:
- It renames your folder to a special name that makes File Explorer show it as a Control Panel shortcut, and marks it hidden and system.
- To unlock, it asks for a password and compares what you type with the password written inside the .bat file itself.
The problems are serious:
- The password is in plain text. Right-click the .bat file, choose Edit, and the password is there for anyone to read.
- The files are not encrypted. Anyone who shows hidden and protected system files, or uses the command line, can open the folder without the script.
- It is fragile. Delete or edit the script, or run it twice by mistake, and people regularly find their folder "missing".
It might stop a young child. It will not stop anyone who searches online for how to undo it.
Hiding the folder
You can hide a folder by right-clicking it, choosing Properties and ticking Hidden, or with the command attrib +h +s "C:\path\to\folder", which also marks it as a protected system item. It disappears from normal view.
Anyone who turns on View → Show → Hidden items in File Explorer can see it again, and the files inside are completely normal. Hiding is about tidiness, not security. Our guide on hiding a folder in Windows 11 covers the details.
Compressed (zipped) folders
Windows can turn a folder into a ZIP file, but there is no password option in File Explorer, on Windows 10 or Windows 11. The ZIP is just a smaller copy of the files.
Folder permissions with separate accounts
If each person has their own Windows account, files in your personal folders (Documents, Pictures and so on) are not accessible to standard users by default. You can also tighten permissions on any folder under Properties → Security → Edit.
This is genuinely useful on a family PC, but it has limits. Anyone with an administrator account can take ownership of the folder and change the permissions. And permissions mean nothing if someone removes the drive or boots the PC from a USB stick, because the files are not encrypted.
EFS encryption (Windows Pro and higher)
On Pro, Enterprise and Education, you can right-click a folder, choose Properties → Advanced, and tick Encrypt contents to secure data. The files are now encrypted and tied to your Windows account. Other accounts get access denied, and someone who removes the drive cannot read them.
But there is no folder password. The folder opens automatically whenever you are signed in, so anyone using your session can read it. EFS also decrypts files when you email them or copy them to a FAT32 or exFAT drive. Our comparison of EFS and BitLocker explains where it fits.
A BitLocker-encrypted virtual drive (Windows Pro and higher)
This is the only built-in method that gives you a real, password-protected, encrypted "folder". You create a virtual hard disk file, encrypt it with BitLocker, and attach it when you need it.
- Press Windows+X and choose Disk Management.
- Choose Action → Create VHD. Pick a location and file name, a size large enough for your files, VHDX, and Dynamically expanding. Click OK.
- Right-click the new disk (shown as "Not Initialized") and choose Initialize Disk, using GPT.
- Right-click the unallocated space, choose New Simple Volume, and format it as NTFS with a drive letter.
- In File Explorer, right-click the new drive and choose Turn on BitLocker (on Windows 11, under Show more options).
- Choose Use a password to unlock the drive, enter a strong password, and save the recovery key somewhere safe.
- Let BitLocker finish, then copy your private files into the drive.
- To lock it, right-click the drive in File Explorer and choose Eject. To open it again, double-click the .vhdx file and enter the password.
It works well, but it takes some setting up, it is not available on Home, and the drive stays unlocked until you eject it or restart, even if you walk away from the PC. Our guide to creating an encrypted virtual drive in Windows covers it in more depth.
How the methods compare
| Method | Home? | Real password? | Encrypted? |
|---|---|---|---|
| Batch file locker | Yes | Stored in plain text | No |
| Hidden folder | Yes | No | No |
| Zipped folder | Yes | No | No |
| Separate accounts and permissions | Yes | Your Windows password | No |
| EFS | No | No | Yes |
| BitLocker virtual drive | No | Yes | Yes |
When a small tool is the better answer
If you are on Windows Home, or you want a folder that asks for a password without building virtual disks, a dedicated encryption tool does the job properly. Document Key lets you right-click a folder and choose Encrypt; every file inside is locked with AES-256 and your password, and stays encrypted if you copy it to USB or cloud storage. It can also create a vault drive, similar to the BitLocker virtual drive above but on any edition, that locks itself when you are idle, the PC sleeps or you sign out. A recovery key protects you if you forget the password.
For a full walkthrough of the folder options on Windows 11, see how to password protect a folder in Windows 11.
Whatever method you use, keep a backup of the files and a record of the password and recovery key. Locking yourself out of a folder is far more common than having it broken into, which is why Document Key asks you to print or save a recovery key when you set it up.
Frequently asked questions
Does the folder locker batch file trick work?
It hides the folder, but the password is stored in plain text inside the batch file and the files are not encrypted. Anyone who opens the batch file in Notepad can read the password.
Can I use a BitLocker virtual drive as a locked folder?
On Pro and higher editions, yes. You can create a VHDX file in Disk Management, format it and turn on BitLocker, which gives you a password-protected drive you attach when needed.
Is a password-protected ZIP a good folder lock?
It works for storage and sharing if you use AES-256, but you have to extract files to edit them, which leaves unencrypted copies behind.
