Do you want to lock a folder on your Windows computer? Encrypting a folder allows you to lock the folder to anyone who doesn't have an encryption key, but that's not as strong as locking the folder with OneDrive. We'll show you how to encrypt files in Windows 10 or 11 Pro or Enterprise to password-protect them and how to use OneDrive, 7-Zip, or BitLocker to lock or protect folders and drives.
Quick Ways to Lock Folders on Windows
- If you have Windows Pro or Enterprise edition, you can right-click the folder and encrypt it, or create a VHD and use BitLocker to protect it.
- Drag and drop folders and files you want to lock into your Personal Vault in OneDrive.
- Encrypt your folder using 7-Zip to make it password-protected.
Steps
-
Press ⊞ Win + E to open File Explorer . The File Explorer icon is a folder with a blue clip. You can click the File Explorer icon in the Windows Start menu or press the Windows Key + E to open File Explorer.
- As long as you have any Pro or Enterprise edition of Windows (7, 8, 10, or 11), you can use encryption to lock your folders. However, anyone who logs into your computer account can access the encrypted folder; users with different computer accounts will not.
-
Right-click the folder and click Properties . Use File Explorer to navigate to the folder you want to encrypt. Right-clicking a folder displays a context menu. Click Properties at the bottom of that context menu.Advertisement
-
Click Advanced . It's the button at the bottom of the Properties menu under the "General" tab. This displays the Advanced Attributes menu.
-
Click the checkbox next to "Encrypt contents to secure data" and click Ok . This selects the option to encrypt the folder.
- This option is not available in Windows 10 & 11 Home Edition.
- Click Apply on the next window to set your settings.
-
Select "Apply changes to this folder, subfolders and files" and click Ok . It's the second radio option in the pop-up menu. This applies encryption to all the folders and all the contents within.
- Alternatively, you can click "Apply changes to this folder only" to apply the encryption to the folder only, and not to any of the subfolders or contents within.
-
Click Back up your file encryption key . When you apply the encryption, you will receive a notification in the lower-right corner asking you to back up your file encryption key. Click the notification to display the options for backing up your encryption key.
-
Click Back up now (recommended) . It's the first option that appears in the pop-up when you click the notification.
- Click Next on the following page after you read the on-screen text.
-
Select the format you want to use and click Next . The default file format is "Personal Information Exchange (.pfx)," but you can select one of the other options if you would rather use them instead.
- If you are unsure which option to select, go with the default Personal Information Exchange. Click Next to continue.
-
Click the checkbox next to "Password," create a password and click Next . To create a password, click the checkbox next to "Password" and then enter a password on the line below it. Enter the same password again on the line below "Confirm password" and then click Next in the lower-right corner.
-
Insert a USB thumb drive. Since the certificate contains the key needed to open your encrypted folder, the safest place to save this file is on an external hard drive, such as a USB thumb drive. Insert a USB thumb drive into any available USB port on your computer.
-
Click Browse and select a location of your thumb drive. Click the button that says "Browse" next to the bar that says "Filename." Then, select your USB drive.
-
Enter a filename and click Save . Enter the filename for the encryption key certificate in the line that says "File name." You can enter any filename you want, but you should use a filename that you recognize as the encryption key for your folder. Click Save when you are done.
- Be sure to save the USB drive in a safe location. You will need it if you cannot access the encrypted folder.
-
Click Next and then click Finish . After saving the encryption key certificate, click Next to continue to the last page in the Export wizard. The last page shows a recap of all the steps you have taken. Click Finish to close the export wizard. The folder is now locked to all other users except for you.
- You can access your encrypted folders as long as you are signed into Windows under your user account. No other Windows user (including the admin) will be able to access the folder.
- If your user password is changed by an administrator, or you move the encrypted folder to another computer, you will not be able to access the folder. You will need to import the encryption key certificate to regain access to the folder. [1] X Research source
-
Open the OneDrive folder on your computer. Since the free version of OneDrive is limited, this method is best for those who subscribe to Microsoft 365.
- You can find your OneDrive folder in File Explorer in the navigation menu on the left.
-
Double-click Personal Vault to open it. If you haven't been using the Personal Vault, you'll be walked through setting it up. Microsoft will email you a code to set up the locked folder.
-
Move files or folders you want to protect into the Personal Vault. You can drag and drop files or folders into the "Personal Vault" window, or you can cut and paste them.
-
Lock the folder. You can either wait 20 minutes for the folder to lock automatically or manually lock the folder by clicking the OneDrive icon in the taskbar and selecting Lock Personal Vault .
- To access the folder, you'll need to provide the Microsoft Hello passcode or have a code emailed to you.
- Since your Personal Vault is located within OneDrive, you can access it anywhere, like using the app on your phone or from another computer. [2] X Trustworthy Source Microsoft Support Technical support and product information from Microsoft. Go to source
-
Navigate to the folder you want to protect in File Explorer. Press Win + E to open File Explorer, then use the menu on the left to navigate through your folder system.
- Use this method if you want an easy, free method of encrypting and protecting your data.
-
Right-click the folder you want to protect and click Show more options . Another context menu will open.
- Make sure you have 7-Zip. If you don't already have it, 7-Zip is a free program that you can download and use to open zipped folders, archives , and more .
-
Hover your mouse over "7-Zip" and select Add to archive . A new window will appear.
- If you don't have 7-Zip installed, you won't see these options.
-
Set your encryption options. This window lets you customize how you want to encrypt the selected folder.
- Click the box next to "Delete files after compression" to check it.
- Use the drop-down menu next to "Compression Level" to select "0 - Store."
- Enter an encryption password in the "Encryption" section, then re-enter it to confirm what you typed.
-
Click OK . 7-Zip creates the encrypted folder with the 7-Zip extension, and you can open it using any archiving software (like WinRAR, 7-Zip, or Wise Folder Hider) using the password.
-
Open Disk Management, select the Action tab, and click Create VHD . Since BitLocker locks drives instead of folders, you'll need to create a virtual hard disk (VHD) to protect a folder.
- This is a more complicated, but more secure, method that uses BitLocker that only Windows 10 and 11 Pro & Enterprise computers can use. Other editions of Windows do not have BitLocker. This method is best for professionals or those with sensitive information stored on their computers.
-
Set up your VHD. Click Browse and select a location for your VHD, name it, and select a size. Use "Dynamically expanding" to constantly and automatically expand the VHD as it gets bigger with time.
- Click OK . You'll see the disk listed as "Not Initialized."
-
Right-click your disk and select Initialize Disk . The disk is at the bottom of your screen.
-
Choose a partition style. Make sure the disk is selected in the first section, then choose either MBR or GPT. Note that older versions of Windows do not recognize GPT.
- Click OK to continue.
-
Right-click the empty space next to the disk and click New Simple Volume . A new window will appear.
-
Follow the on-screen instructions. You will select a drive letter (so you can easily identify this disk, and then you will format it.
- You've successfully created a VHD to password-protect the files you put on the disk.
-
Navigate to BitLocker Drive Encryption. In Control Panel, click System and Security > BitLocker Drive Encryption .
-
Click Turn on BitLocker next to the drive you created. You'll see a list of all the drives on your computer under the "Fixed data drives" header. If you click the down-arrow next to the drive you created, you'll see an option to "Turn on BitLocker."
-
Choose "Use a password…." and enter the password. No one will be able to access your drive without first entering the password.
-
Choose an option for your recovery key. If you're using a computer account with a Microsoft account, the easiest option is "Save to your Microsoft account." However, if you're using a local account, you can save the recovery key to a file, save it to a USB drive, or print it.
- Click Next to continue.
-
Choose "Encrypt used disk space…" and click Next . Only the space you're using will be encrypted, which is the faster option.
-
Choose "Compatible Mode" and click Next . This is the best option for your VHD.
-
Click Start Encryption . Now you've created a protected disk! All you need to do is double-click the drive to mount it, go to "This PC" and double-click the file again, then enter the password.
- Even though initially mounting the drive gives you an error, entering the password will get rid of the message.
- Drag and drop or cut and paste folders and files into the disk you want to protect.
- When you're done, right-click the drive in File Explorer and select ' Eject .
- Since you created the disk as "compatible mode," you can move it to a flash drive and off your computer. [3] X Research source
Community Q&A
-
QuestionWhat happens if I forget the password?Community Answer1. Click Start > Open the "Run" dialog > Type: regedit and hit Enter. 2. Open Registry Editor and go to: HKEY_CURRENT_USER. 3. Click "Software" > "new software" > "folder lock" > "Uninstall". 4. Edit the value to 0; 5. Go to Control Panel and uninstall Folder Lock.
-
Questionif folder locker.bat got deleted then How the locked folder will be accessed? Will deleting folderlocker.bat will delete the locked file?Community AnswerType this into command prompt: cd "" attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker.
-
QuestionHave locked folders on a USB but after they are locked can still search with a file extension (eg. docx) and all files with that extension will show up! Not much point locking them.Chris GootosCommunity AnswerWhat's the logic to lock the folders? To not allow access to files or to completely hide the folder from search parameters? You can right-click, then properties, then on the bottom you can choose "hide"; however, you're probably best off by restricting the permissions of the folders to access only by you through the System Permissions of the file or folder.
Tips
References
About This Article
1. Open the folder.
2. Create a new text file called "lock.txt" inside.
3. Open the file.
4. Copy the lock code from https://www.laptopmag.com/articles/password-protect-folder-windows-10
.
5. Paste it into the file.
6. Replace "Your-Password-Here" with a password.
7. Save the file as "FolderLocker.Bat" and close the window.
8. Double-click FolderLocker.Bat
in the folder.
9. Drag files to protect to the new fodler called "Locker."
10. Double-click FolderLocker.Bat and press the Y
key.