Windows cannot put a password on a plain folder, so to password protect a folder in Windows you wrap it in something that can: an encrypted 7-Zip archive that asks for a password every time, or the built-in encryption that is tied to your Windows account. The archive is the closest match to what most people want, and it works on every edition of Windows.
This guide covers three real options, what each one protects against, and the cases where each one fails. It also explains why the popular "batch file with a fake locker folder" trick should not be used for anything private.
Which method should you use?
| Method | Asks for a password? | Editions | Best for |
|---|---|---|---|
| Encrypted 7z archive (7-Zip) | Yes, its own password | All, including Home | Files you store or send, and rarely edit |
| EFS (folder encryption) | No, uses your Windows sign-in | Not Home | Keeping files from other accounts on the same PC |
| BitLocker | Depends on how it is set up | Pro, Enterprise, Education | A lost or stolen laptop |
If you want a separate password that you type to open the files, choose the archive. If you only want other people who sign in to the same PC to be locked out, EFS is simpler. If your worry is losing the device, encrypt the whole drive instead of a folder.
How to password protect a folder with 7-Zip
7-Zip is a free archiver. Its site says the 7z code is distributed under the GNU LGPL and that it supports encryption with the AES-256 algorithm. Download it only from the official site, 7-zip.org. The steps below put a copy of your folder into one encrypted file.
- Install 7-Zip, then right-click the folder in File Explorer. On Windows 11, select Show more options first if you do not see the 7-Zip entry.
- Choose 7-Zip, then Add to archive....
- Set Archive format to 7z.
- In the Encryption box, type a password twice. Check that the encryption method is AES-256.
- Tick Encrypt file names. Without it, anyone can see the list of file names inside the archive even though they cannot read the contents.
- Click OK. 7-Zip creates a
.7zfile next to the folder.
The original folder is still there and still unprotected. Open the archive first (double-click it and enter the password) to confirm the files are inside, then delete the original folder. Be aware that deleting a file in the normal way does not guarantee it cannot be recovered from the disk later, and the Recycle Bin keeps a copy until you empty it.
The trade-off is convenience. To edit a file you extract it, change it, and add it back to the archive. While it is extracted, it sits unprotected on disk. For documents you need to touch every day, EFS is easier. For tax records, scans of ID, or a backup you plan to put on a USB stick or in cloud storage, the archive is the better fit because the protection travels with the file.
Choosing a password for the archive
The password is the whole defence. Someone who copies your .7z file can try guesses against it offline, as fast as their hardware allows. A short or predictable password will fall quickly no matter how strong AES-256 is. Use a long passphrase and keep it in a password manager. For the maths behind that advice, see password entropy explained and how long it takes to crack a password. The larely password generator runs entirely in your browser if you need one.
How to lock a folder with Windows built-in encryption (EFS)
The Encrypting File System is built into Windows. Microsoft's support page describes the steps and states that file encryption is not available in the Home edition of Windows.
- Right-click the folder and select Properties.
- Select Advanced....
- Tick Encrypt contents to secure data.
- Click OK, then Apply, then OK.
This is not a password prompt. Once you are signed in, your files open as normal, and so do they for any program running under your account. What it does is stop other Windows accounts, and anyone who removes the drive and reads it elsewhere, from reading the files. Microsoft describes the feature as letting only individuals with the correct decryption key access the contents, and that key belongs to your account.
The same thing from a command prompt uses cipher. Microsoft's reference says /e encrypts the specified files or directories and marks directories so that files added afterward are encrypted too. Example, using a folder called Private:
cipher /e private
Example output, adapted from the reference page:
Encrypting files in C:\Users\alex\Documents\
Private [OK]
1 file(s) [or directorie(s)] within 1 directorie(s) were encrypted.
Run cipher with no parameters to list the state of the current folder: E means encrypted and U means unencrypted. Back up your key with cipher /x, which the reference says backs up the EFS certificate and keys to the file name you give it. Without that backup, reinstalling Windows or losing your profile can leave the files unreadable. For more detail on EFS, key backup and the Mac equivalent, see how to encrypt a folder on Windows and Mac.
What about BitLocker?
BitLocker protects an entire volume, not a single folder. Microsoft's overview says it addresses data theft or exposure from lost, stolen, or inappropriately decommissioned devices, and lists Windows Pro, Enterprise, Pro Education/SE and Education as the editions that support it. It is the right answer if a stolen laptop is your main concern, because everything on the drive is covered.
It is the wrong tool for hiding one folder from the person sitting at your unlocked PC. Once the drive is unlocked and you are signed in, nothing is asked of you per folder. The same overview also warns about one setup choice: on devices without a TPM, BitLocker can use a password to open the operating system drive, but Microsoft calls this option insecure because there is no password lockout logic, and says it is discouraged and disabled by default.
Why the "locker" batch file trick does not work
Many pages online offer a .bat script that renames a folder, hides it, and asks for a password before revealing it. The password sits as plain text inside the script, which anyone can open in Notepad. The files themselves are never encrypted: the script only changes the folder's name and attributes. Anyone who knows to look, or who opens the drive from another system, reads everything. Do not use it for anything you would mind others seeing. The same goes for simply marking a folder as hidden in Properties: that is an attribute, not protection.
Common problems
- The Encrypt contents box is greyed out. Check your edition under Settings, System, About. Windows Home does not offer file encryption. The cipher reference also says the command works on NTFS volumes, so a FAT32 or exFAT USB stick will not work.
- The 7-Zip menu is missing. On Windows 11 it is under Show more options in the right-click menu. You can also open 7-Zip File Manager from the Start menu and use Add from the toolbar.
- Someone can see file names in the archive. You created it without Encrypt file names. Create it again with that box ticked.
- You need the files on another computer. EFS will not follow you, because the key belongs to your account. Use the archive, which opens anywhere 7-Zip runs, or a PDF-level option such as encrypting a PDF with a password for single documents.
Back up before you lock
Any method here can lock you out permanently if you lose the password or key. Before deleting an original, open the protected copy and confirm the files are intact. Keep the password in a manager, and keep the EFS key export on a drive that is not the same PC. Our guide to how password managers work explains where those secrets can safely live.
Frequently asked questions
- Can I put a password on a folder in Windows 11 without extra software?
- Not directly. Windows has no setting that asks for a password when you open a plain folder. The built-in options are EFS, which ties the folder to your Windows account and is missing from Home edition, and BitLocker, which encrypts a whole drive and is available in Pro, Enterprise and Education editions.
- Is a 'hidden folder' the same as a password-protected folder?
- No. Hiding a folder only sets an attribute that File Explorer respects. Anyone can switch on 'Hidden items' in the View menu and open it, and nothing is encrypted. Treat hiding as a convenience, not as protection.
- What happens if I forget the password to an encrypted 7z archive?
- You cannot open it. 7-Zip derives the AES-256 key from your password, so there is no reset or recovery option. Store the password in a password manager before you delete the original files.
- Does 7-Zip use strong encryption?
- The 7-Zip site states that 7-Zip supports encryption with the AES-256 algorithm, with the key derived from a text password using a SHA-256-based function and many iterations to make guessing harder. The strength in practice depends mostly on how long and unpredictable your password is.