If your Windows doesn't support the Mount-DiskImage -ImagePath command, follow these steps to automount your VHDX file.
Create The Script
- Open Notepad and create a new file. Add this script:
select vdisk file="<path_to_your_vdhx_file>"
attach vdisk
- Example:
select vdisk file="D:\MyVirtualDisk.vhdx"
attach vdisk
Save the file as .txt file
Create New Task Scheduler
Look at the Action Panel on the right side, or click Action on Status Bar, then click Create Task

Fill in the Name field (it's up to you), Choose Run whether user is logged on or not, and check Run with highest privileges too

-
Go to Action tab, then click New
- Choose Start a program for Action field.
- Type
powershell.exefor Program/script - Add arguments
diskpart /s "<your_txt_script_path_you_created_in_the_first_step>"(e.g.,diskpart /s "D:\script.txt") - Click OK
Go to Conditions tab, make sure to uncheck Start the task only if the computer is on AC power, then click OK.





Top comments (2)
Solid PowerShell approach. The modern alternative: if you don't actually need a full NTFS volume (e.g. you just want a drive letter backed by cloud storage), ScsDriver (USD 9.99/year) does it without VHDX — works on Windows Server / Win 11, auto-mounts at login, and survives reboots cleanly.
VHDX auto-mount is a useful trick — gives you a real NTFS filesystem that survives reboots without consuming real disk space beyond what you put in the VHDX. Three patterns I keep returning to: