How to lock files in Windows 11

Windows 11 add password to folder

(Image credit: Future)

On Windows 11, you won't find a feature to add a password to a folder to protect your files because your account is already protected with a password and encryption, and it's assumed that you will be the only one using it. 

However, if you share the computer with others, are concerned about unauthorized access, or want to add another layer of security, you can use the virtual hard disk feature along with BitLocker to protect files and folders with a password on Windows 11.

This guide will walk you through the steps to protect a folder with a password using drive virtualization and encryption features available on Windows 11.

How to add password to folder on Windows 11

Windows 11 doesn't have a feature to protect a folder with a password because the account is already protected with your profile credentials. However, you can use the virtual drive and BitLocker features to create a drive you can secure with a password, which works similarly to a password-protected folder.

Create virtual drive to act as a folder

To create a virtual drive that will act as a password-protected folder, use these steps:

  1. Open Start.
  2. Search for Disk Management and click the top result to open the app.
  3. Click the Action menu.
  4. Click the Create VHD option.

Disk Management create VHD option

(Image credit: Future)
  1. Click the Browse button to select a location to store the virtual disk.
  2. Specify a name for the drive — for example, vault.
  3. Click the Save button.
  4. Under the "Virtual hard disk size" section, specify the space you want to reserve for storage. For instance, 10GB, but you can use any amount based on the content you want to protect.
  5. (Optional) Under the "Virtual hard disk format" section, select the VHDX option.
  6. Select the Dynamically expanding option to allow the storage will only grow as you save files.

Create VHDX settings

(Image credit: Future)
  1. Click the OK button.
  2. Right-click the newly created virtual disk and select the Initialize Disk option.

Windows 11 initialize disk option

(Image credit: Future)
  1. Check the newly created disk.
  2. Select the GPT option.

Initialize disk settings

(Image credit: Future)
  1. Click the OK button.
  2. Right-click the "Unallocated space" and select the New Simple Volume option.

New simple volume

(Image credit: Future)
  1. Click the Next button.
  2. Use the default volume size settings.
  3. Click the Next button.
  4. Use the "Assign the following drive letter" drop-down menu to select a new one.

Disk Management assign drive letter

(Image credit: Future)
  1. Click the Next button.
  2. Use the "File system" drop-down menu, and select the NTFS option.
  3. Use the "Allocation unit size" drop-down menu, and select the Default option.
  4. In the "Value label" field, type a descriptive name for the drive. For example, vault.
  5. Check the Perform a quick format option.

Drive format settings

(Image credit: Future)
  1. Click the Next button.
  2. Click the Finish button.

Once you complete the steps, the virtual drive will be created, and you can now use it as a folder to securely store files by encrypting it using BitLocker.

Set up BitLocker on virtual drive 

To set up BitLocker to protect the drive with a password on Windows 11, use these steps:

  1. Open Settings.
  2. Click on System.
  3. Click the Storage page on the right side.

Open Storage settings

(Image credit: Future)
  1. Under the "Storage management" section, click on Advanced storage settings.
  2. Click the "Disks & volumes" setting.

Open Disks & volumes

(Image credit: Future)
  1. Select the volume of the virtual drive and click the Properties button.

Open virtual drive properties

(Image credit: Future)
  1. Click the Turn on BitLocker option at the bottom of the page.

Open BitLocker settings

(Image credit: Future)
  1. Under the "Fixed data drives" section, select the vault drive.
  2. Click the Turn on BitLocker option.

Control Panel enable BitLocker

(Image credit: Future)
  1. Check the "Use a password to unlock the drive" option.
  2. Create a password to protect your folders inside the drive.

Create password on BitLocker

(Image credit: Future)
  1. Click the Next button.
  2. Select the "Save to your Microsoft account" option. 

Save BitLocker to Microsoft account

(Image credit: Future)
  • Quick note: Using the Microsoft account is the most convenient option. However, you can choose any of the other available options.
  1. Click the Next button.
  2. Select the "Encrypt used disk space only" option.

Encrypt used disk space only

(Image credit: Future)
  1. Click the Next button.
  2. Select the Compatible mode option.

BitLocker compatibility mode

(Image credit: Future)
  1. Click the Next button.
  2. Click the Start encryption button.
  3. Click the Close button.

After you complete the steps, the virtual drive will be secured with a password.

Unlock password-protected folder

To open a folder with a password on Windows 11, use these steps:

  1. Open File Explorer.
  2. Open the folder with the vault.vhdx file.
  3. Double-click the VHD (VHDX) file to mount it to File Explorer. 

Open VHD file

(Image credit: Future)
  • Quick note: If you receive a "is not accessible" and "Access is denied" message, this is normal behavior because you mounted the drive but haven't unlocked it with the password yet.
  1. Click on This PC from the left navigation pane.
  2. Under the "Devices and drives" section, double-click the drive to open the sign-in page.
  3. Type the password to unlock the drive. 

Unlock folder password protected on Windows 11

(Image credit: Future)
  • Quick tip: If you can't remember the password, click the More options link, select the Enter recovery key option, and type the 48-digit recovery key available on your Microsoft account. (opens in new tab)
  1. Click the Unlock button.

Once you complete the steps, the drive will open, allowing you to add, modify, and remove your sensitive files.

Lock folder 

To close and lock a folder with a password on Windows 11, use these steps:

  • Open File Explorer.
  • Click on This PC from the left navigation pane.
  • Under the "Devices and drives" section, right-click the BitLocker drive, and select the Eject option.

Windows 11 password protect folder

(Image credit: Future)

After you complete the steps, the folder (drive) will lock, and the password will be required to unlock the contents again.

More resources

For more helpful articles, coverage, and answers to common questions about Windows 10 and Windows 11, visit the following resources:

  • Windows 11 on Windows Central — All you need to know
  • Windows 10 on Windows Central — All you need to know

Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.