Add VHD and VHDX to the Right-Click Menu

Written by

in

To add Virtual Hard Disk (VHD and VHDX) options to the Windows right-click context menu, you can either restore the native, built-in “Mount” feature or add custom commands using the Windows Registry Editor.

Modern versions of Windows have this capability built-in by default. However, third-party archiving software like 7-Zip or WinRAR often hijacks the file association, causing the option to vanish.

Here is how to get the VHD context menu working, whether you are restoring the native option or building a custom advanced script. Method 1: Restore the Native “Mount” Menu (Easiest)

If you just want the standard right-click Mount option to reappear, you need to fix the default app association: Open File Explorer and find any .vhd or .vhdx file.

Right-click the file and hover over Open with, then select Choose another app. Select Windows Explorer (or File Explorer) from the list.

Check the box that says “Always use this app to open .vhd files”.

Click OK. The native Mount option will instantly return to your context menu.

Method 2: Create Custom “Attach” and “Detach” Actions via Registry

If you want explicit, permanent custom entries in your context menu for managing virtual disks, you can inject them directly into the Windows Registry. Step 1: Open the Registry Editor Press Win + R, type regedit, and press Enter. Click Yes if the User Account Control (UAC) prompt appears. Step 2: Add the “Attach” Command

Navigate to the following path in the left sidebar:HKEY_CLASSES_ROOT\Windows.VhdFile\shell

Right-click the shell folder, select New, and click Key. Name it Attach.

Click the new Attach key. In the right pane, double-click (Default) and set its Value data to Attach VHD.

Right-click your newly created Attach folder, select New, and click Key. Name this sub-key command.

Click the command key. In the right pane, double-click (Default) and paste the following exact string:

powershell.exe -WindowStyle Hidden -Command “Mount-DiskImage -ImagePath ‘%1’” Use code with caution. Step 3: Add the “Detach” Command Go back to HKEY_CLASSES_ROOT\Windows.VhdFile\shell.

Right-click shell, select New, and click Key. Name it Detach.

Click the Detach key. In the right pane, double-click (Default) and change its Value data to Detach VHD.

Right-click the Detach folder, select New, and click Key. Name this sub-key command.

Click the command key. In the right pane, double-click (Default) and paste the following text:

powershell.exe -WindowStyle Hidden -Command “Dismount-DiskImage -ImagePath ‘%1’” Use code with caution.

(Note: If you use both .vhd and .vhdx extensions, you will need to repeat Step 2 and Step 3 under the path HKEY_CLASSES_ROOT\Windows.VhdFile.Vhdx\shell.) Method 3: Use Free Third-Party Tools

If modifying the Windows registry manually feels too risky, you can safely use lightweight, community-trusted software to handle the context menu modification for you:

Easy Context Menu by Sordum: A portable freeware tool that lets you check boxes to seamlessly append advanced scripts (like compacting, mounting, or unmounting VHDs) right into your mouse menu without manually typing code.

If you run into any permission issues or want to customize this further, let me know: Which Windows version (10 or 11) are you running?

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *