PDF download Download Article
Keep your Windows files safe and private with this user-friendly guide
PDF download Download Article

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.
Method 1
Method 1 of 4:

Using Windows Pro & Enterprise

PDF download Download Article
  1. 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
  2. It's the button at the bottom of the Properties menu under the "General" tab. This displays the Advanced Attributes menu.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. Click the button that says "Browse" next to the bar that says "Filename." Then, select your USB drive.
  11. 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.
  12. 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]
  13. Advertisement
Method 2
Method 2 of 4:

Using OneDrive

PDF download Download Article
  1. 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.
  2. 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.
  3. You can drag and drop files or folders into the "Personal Vault" window, or you can cut and paste them.
  4. 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]
  5. Advertisement
Method 3
Method 3 of 4:

Using 7-Zip

PDF download Download Article
  1. 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.
  2. Another context menu will open.
  3. A new window will appear.
    • If you don't have 7-Zip installed, you won't see these options.
  4. 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.
  5. 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.
  6. Advertisement
Method 4
Method 4 of 4:

Using BitLocker

PDF download Download Article
  1. 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.
  2. 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."
  3. The disk is at the bottom of your screen.
  4. 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.
  5. A new window will appear.
  6. 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.
  7. In Control Panel, click System and Security > BitLocker Drive Encryption .
  8. 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."
  9. and enter the password. No one will be able to access your drive without first entering the password.
  10. 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.
  11. Only the space you're using will be encrypted, which is the faster option.
  12. This is the best option for your VHD.
  13. 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]
  14. Advertisement

Community Q&A

Search
Add New Question
  • Question
    What happens if I forget the password?
    Community Answer
    1. 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.
  • Question
    if folder locker.bat got deleted then How the locked folder will be accessed? Will deleting folderlocker.bat will delete the locked file?
    Community Answer
    Type this into command prompt: cd "" attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker.
  • Question
    Have 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 Gootos
    Community Answer
    What'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.
See more answers
Ask a Question
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      Article Summary X

      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.

      Did this summary help you?
      Thanks to all authors for creating a page that has been read 152,224 times.

      Is this article up to date?

      Advertisement