How to delete a VHDX completely in windows 11?

Alvaro J Vanegas 10 Reputation points
2023-12-11T03:53:02.39+00:00

A few days ago I tried to create a VHDX on my own, my intention was to test how is this functionality but now that I want to remove it from the system since I will not make use of the VHDX I can not do it, I have unmounted the VHDX from the configuration panel and also try to delete the VHDX file that is created but this does not allow me to delete it since it says to be in use, I tried to investigate how to delete that . vhdx file and I found tutorials where the removal of a VHD is done directly by deleting it from the disk manager, trying this worsened the situation because I can no longer make use of that VHDX How can I get rid of this?

Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2023-12-14T06:22:50.23+00:00

    Hi Alvaro J Vanegas,

    Please open cmd as administrator and run diskpart.

    1. Run list vdisk to displays the attached virtual disks.
    2. If the vhdx is listed, run select vdisk file="<vhdx file path>" to select the specified virtual disk.
    3. Run detach vdisk to detach the selected virtual disk.

    https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/diskpart

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    18 people found this answer helpful.

  2. Claudia Dos Santos Haz (CONCENTRIX CORPORATION) 1,120 Reputation points Microsoft External Staff
    2023-12-11T10:02:12.33+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.