Convert-WindowsImage.ps1 — WIM2VHD for Windows 10 (also Windows 8 and 8.1)

Convert-WindowsImage is the new version of WIM2VHD designed specifically for Windows 8 and above. Written in PowerShell, this command-line tool allows you to rapidly create sysprepped VHDX and VHDX images from setup media for Windows 7/Server 2008 R2, Windows 8/8.1/Server 2012/R2

4.6 Star
142,303 times
Add to favorites
E-mail Twitter Digg Facebook
  • Fails during "Attaching VHDX" on Server 2012 RC
    2 Posts | Last post June 27, 2012
    • I've been trying to use the script to convert a Server 2012 RC ISO image into a VHD, but it fails every time with a strange error at the "Attaching VHDX..." stage. I've tried selecting both VHD and VHDX formats, with exactly the same result. I'm running the script on a Server 2012 RC (8400) VM under 2008R2 SP1 Hyper-V.
      Am I doing something stupid here?
      PS C:\isos> .\Convert-WindowsImage.ps1 -showui
      Windows(R) Image to Virtual Hard Disk Converter for Windows(R) 8
      Copyright (C) Microsoft Corporation.  All rights reserved.
      Version 6.2.8424.1.amd64fre.fbl_core1_hyp_dev(mikekol).120517-1616 Release Preview
      INFO   : Launching UI...
      INFO   : Opening ISO 8400.0.WINMAIN_WIN8RC.120518-1423_X64FRE_SERVER_EN-US-HRC_SSS_X64FRE_EN-US_DV5.ISO...
      INFO   : Looking for E:\sources\install.wim...
      INFO   : Scanning WIM metadata...
      INFO   : Image 1 selected (ServerStandardCore)...
      INFO   : Creating sparse disk...
      INFO   : Attaching VHDX...
      ERROR  : Exception calling "Attach" with "0" argument(s): "The I/O operation has been aborted because of either a thread
       exit or an application request"
      INFO   : Log folder is C:\Users\Chris\AppData\Local\Temp\Convert-WindowsImage\c55ea307-dfb1-4809-acb3-4147411f8a3c
      INFO   : Closing Windows image...
      INFO   : Closing VHDX...
      INFO   : Done.
    • Hi Chris,
      No you don't appear to be doing anything stupid, so you've got that going for you :)
      This is the first time I've seen this error, so I'm a bit stumped at the moment.  This is just a shot in the dark, but can you try opening up an elevated command prompt (*not* PowerShell), and run PowerShell.exe -STA please?
      Once you've got your new PowerShell session opened, please try running the script again to see if you still run into the error.
  • Do I need to have Hyper-V installed to use Convert-WindowsImage?
    1 Posts | Last post June 04, 2012
    • Nope, Hyper-V is not used by Convert-WindowsImage *at all*.  You can create VHDs and VHDXs without installing Hyper-V on your Windows 8 or Windows Server 2012 machine - you can even create them on your x86 machines!
  • no script for Windows 7?
    2 Posts | Last post June 04, 2012
    • I am looking for a similar script which makes VHD images of Windows 8 while still running Windows 7
    • Check out the original WIM2VHD at
  • Yes please add support for running on Windows 7. Thx
    2 Posts | Last post June 04, 2012
    • Thank you for the great script. It would make it even more fantastic if you could add support for it running on Windows 7. Thanks a lot.
    • Unfortunately, Convert-WindowsImage relies on some PowerShell cmdlets that aren't available of Windows 7 (specifically, the storage-centric cmdlets), and it would be quite a bit of work to maintain two separate code-paths for Windows 8 and Windows 7 in the same script.
      To create Windows 8 VHDs on a Windows 7 machine, we recommend you use WIM2VHD, available at  
151 - 154 of 154 Items