WIM2VHD: convertitore da WIN a VHD

Su MSDN Code Gallery spesso soluzioni interessanti, tra le varie una degna di nota è sicuramente lo script Windows(R) Image to Virtual Hard Disk (WIM2VHD) Converter.

Tramite WIM2VHD è possibile convertire un file in formato WIM nel formato VHD. Ciò significa che è possibile creare dei VHD per librerie di VM per i sistemi rilasciati tramite il formato wim (Windows Vista e successivi) evitando ad esempio SysPrep.

Lo script richiede Windows AIK o OPK (OEM Preinstallation Kits) e consente anche di automatizzare la creazione del VHD come si può vedere dagli esempi proposti sulla pagina del progetto:

Create a Windows Server 2008 R2 Server Standard Core VHD, named foo.vhd
CSCRIPT WIM2VHD.WSF /WIM:X:\sources\install.wim /SKU:SERVERSTANDARDCORE /VHD:C:\foo.vhd

Create a Windows Server 2008 R2 Server Standard VHD with an automatically generated name
CSCRIPT WIM2VHD.WSF /WIM:X:\sources\install.wim /SKU:SERVERSTANDARD

Create a Windows 7 Home Premium VHD with an automated setup answer file
CSCRIPT WIM2VHD.WSF /WIM:X:\sources\install.wim /SKU:HOMEPREMIUM /UNATTEND:C:\stuff\unattend.xml

Apply the first image in a custom WIM to a VHD named custom.vhd
CSCRIPT WIM2VHD.WSF /WIM:C:\stuff\custom.wim /SKU:1 /VHD:C:\custom.vhd

Create a Windows 7 Ultimate VHD, and copy a folder structure to the root of the drive
CSCRIPT WIM2VHD.WSF /WIM:X:\sources\install.wim /SKU:ULTIMATE /MERGEFOLDER:C:\Deploy\VHDROOT

Create a Windows 7 Ultimate VHD without leaving a signature file on the disk
CSCRIPT WIM2VHD.WSF /WIM:X:\sources\install.wim /SKU:ULTIMATE /SIGNDISK:FALSE

Create a Windows 7 Ultimate VHD and display the output in verbose/trace mode
CSCRIPT WIM2VHD.WSF /WIM:X:\sources\install.wim /SKU:ULTIMATE /TRACE:TRUE

Copy all of the binaries that WIM2VHD.WSF requires to C:\WIM2VHD, so that it can be easily moved from one machine to another
CSCRIPT WIM2VHD.WSF /WIM:X:\sources\install.wim /COPYLOCAL:C:\WIM2VHD