How to Make VHD/VHDX Mount Automatically in Windows 11?
Automatic mounting of VHD and VHDX files (virtual hard disk files that act as extra drives on your PC) saves you from manually connecting them after every restart in Windows 11. These disk image formats hold extra data and run virtual machines, but Windows unmounts them by default when you turn off your computer.
A short script combined with the Task Scheduler (a tool that runs programs on a schedule) lets you attach these virtual drives automatically every time you sign in to your user account.
Open Task Scheduler, create a new task, and name it. Configure it to run with highest privileges at startup, then set the action to run PowerShell with the Mount-DiskImage command, specifying your VHD/VHDX file path.
Set Up Your Automatic VHD Connection Task
We will use a Windows tool called Task Scheduler. It helps automate tasks. We will guide you through each step.
Step 1Open Task Scheduler
Press Win+R to open the Run dialogue box, type taskschd.msc, and press Enter.
Step 2Create a New Task
In Task Scheduler, click on “Task Scheduler Library” in the left panel. Then, in the right panel under “Actions,” click “Create Task…”.

Step 3Name Your Task
Giving your task a clear name helps you find it later when you want to change how you mount vhdx automatically. Type a distinct title like “Mount My VHD at Startup” in the name box. You can also paste the full file path of your virtual disk into the description box so you always know which drive this specific task connects.
In the "Description" box, you can type the full address (path) of the VHD or VHDX file you want to connect. This helps you know which virtual disk the task is for if you have many. For example, you could type:D:\MyVirtualDisks\ImportantData.vhdx
Step 4Set Up Automatic Running
Setting up automatic running requires you to grant the task special permissions so it can mount vhdx automatically in the background. Open the General tab in Task Scheduler and select both "Run whether user is logged on or not" and "Run with highest privileges". This gives the task the necessary administrator rights to connect your virtual disk without needing you to sign in first.
- Run whether user is logged on or not: This makes sure the task runs even when you are not logged in.
- Run with highest privileges: This is important because connecting drives needs administrator permission. This box gives the task the needed rights.
In the "Configure for" dropdown menu, select Windows 10. This setting is often more compatible with these types of system tasks, even when running on Windows 11.

Step 5Choose When the Task Runs (Trigger)
Choosing when the task runs tells Windows to mount vhdx automatically every time your computer boots up. Go to the Triggers tab, create a new trigger, and select "At startup" from the dropdown menu. You can also add a short delay here if your computer is slow to load other programs when it first turns on.
Optional Delay: Sometimes, your computer might still be starting other programs when the task runs. If the task sometimes fails, you can add a delay. Check the "Delay task for" box and choose a short time, like 30 seconds or 1 minute. This gives your computer a moment to finish starting up.
After setting "At startup" (and a delay if you want), click "OK".

Step 6Choose What the Task Does (Action)
Telling the task what to do involves giving it the right command to mount vhdx automatically using Windows PowerShell. Open the Actions tab, click "New...", and type "PowerShell" into the program box. Then, paste your specific mount command into the arguments box so the tool knows exactly which virtual disk file to open.
In the "Action" window:
- In the "Program/script" box, type
PowerShell. - In the "Add arguments (optional)" box, type the command to connect your virtual disk:
Mount-DiskImage -ImagePath 'Your\Full\Path\To\Your.vhdx'
Very Important: You MUST replace 'Your\Full\Path\To\Your.vhdx' with the actual, full address (path) of the VHD or VHDX file you want to connect. Keep the single quotes around the path. For example, if your file is at E:\Virtual Machines\MyData.vhdx, your command would look like this:
Mount-DiskImage -ImagePath 'E:\Virtual Machines\MyData.vhdx'
After typing the command with your file path, click "OK".
A mistake here is the most common reason the task won't work. Make sure the file is really there.

Step 7Check Settings and Finish
Click the "Conditions" tab. You will see options about power. To make sure it works even when your computer is on battery, uncheck the box that says "Start the task only if the computer is on AC power." Click "OK" when you are finished with this tab.
Step 8Enter Your Password
Since you chose "Run whether user is logged on or not" and "Run with highest privileges," Windows needs to verify your identity. It will ask for the password for your current Windows account. Type it in and click "OK".
Step 9Check Your New Task
Checking your new task ensures everything is set up correctly to mount vhdx automatically the next time your computer restarts. Look in the main Task Scheduler window under the Task Scheduler Library to find your newly created task name. If you see it listed there, your virtual drive is fully ready to connect on its own.
You have now set up your VHD or VHDX file to connect automatically every time you start your computer. When you restart your PC and log in, your virtual drive should be connected and ready to use in File Explorer.
Manage Your Automatic Task
Managing your automatic tasks lets you control when your computer tries to mount vhdx automatically without having to recreate the setup. Open the Task Scheduler Library and right-click your task to temporarily disable it, turn it back on, or open its properties to change the file path. This gives you full control over your virtual drives.
- Enable/Disable: To stop the VHD from connecting automatically, right-click your task in Task Scheduler Library and choose "Disable." To turn it back on, choose "Enable."
- Edit: Need to change the VHD file path or other settings? Right-click the task and choose "Properties." This opens the same window where you set it up.
- Delete: If you don't need automatic connection anymore, right-click the task and choose "Delete."
This small setup can save you a lot of time if you use VHD or VHDX files often. Enjoy the convenience!
Summary
Using Windows Task Scheduler to mount vhdx automatically saves you from having to connect your virtual disks by hand every time. This guide walked you through creating a startup task with administrator rights that runs a simple command in the background. Your virtual drives will now be ready and waiting as soon as your computer turns on.
How to permanently mount a VHD?
How to permanently attach a VHD: Actions for the task In the “New Action” window, type powershell.exe in the Program/script field. Then, in the “Add arguments (optional)” text field, type this command: Mount-DiskImage “Path to the VHD file”.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!