DEV Community

Awaliyatul Hikmah
Awaliyatul Hikmah

Posted on

1 1 1 1 1

How to Automounting Your VHDX on Windows 11 Without Mount-DiskImage Command

If your Windows doesn't support the Mount-DiskImage -ImagePath command, follow these steps to automount your VHDX file.

Create The Script

  1. Open Notepad and create a new file. Add this script:
select vdisk file="<path_to_your_vdhx_file>"
attach vdisk
Enter fullscreen mode Exit fullscreen mode
  • Example:
select vdisk file="D:\MyVirtualDisk.vhdx"
attach vdisk
Enter fullscreen mode Exit fullscreen mode

Save the file as .txt file

Create New Task Scheduler

  1. Click the Windows Button and search for Task Scheduler
    Klik Windows Button, Search Task Scheduler

  2. Look at the Action Panel on the right side, or click Action on Status Bar, then click Create Task
    Create Task

  3. 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
    Fill the form

  4. Go to Trigger tab, then click New
    Add new trigger

  5. Choose At startup for Begin the task, and Check Enabled
    Config trigger

  6. Go to Action tab, then click New

    • Choose Start a program for Action field.
    • Type powershell.exe for 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 Config action
  7. Go to Conditions tab, make sure to uncheck Start the task only if the computer is on AC power, then click OK.
    Config condition

  8. Enter your password, then click OK
    Input password

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay