A. There might be times when you're not sure of the OS version in a VHD. You can find this information using the /Get-CurrentEdition switch of the Deployment Image Servicing and Management (DISM) tool. In the example below, I first create a VHD containing the Windows 7 Home Basic SKU using the wim2vhd tool. Then I check the version of the VHD using DISM after I mount it using DISKPART.
D:\Documents\Scripts>cscript WIM2VHD.wsf /wim:"D:\OS Images\Windows 7 Ult 64-bit
\sources\install.wim" /sku:HOMEPREMIUM /vhd:d:\temp\win7hpstd.vhd
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Windows(R) Image to Virtual Hard Disk (WIM2VHD) Converter
Copyright (C) Microsoft Corporation. All rights reserved.
Version 6.1.7600.0
Check for updates at http://code.msdn.microsoft.com/wim2vhd!
MACHINE INFO:
Build=7601
Platform=amd64fre
OS=Windows 7 Ultimate
ServicePack=Service Pack 1, v.721
Version=6.1
BuildLab=win7sp1_rc
BuildDate=100929-1730
Language=en-US
INFO: Looking for IMAGEX.EXE...
INFO: Looking for BCDBOOT.EXE...
INFO: Looking for BCDEDIT.EXE...
INFO: Looking for REG.EXE...
INFO: Looking for DISKPART.EXE...
INFO: Session key is ACFE1CDE-EF94-4D7F-9370-7377537B8CB8
INFO: Inspecting the WIM...
INFO: Configuring and formatting the VHD...
INFO: Applying the WIM...
\\[ 100% \\] Applying progress
INFO: Making the VHD bootable with BCDBoot...
INFO: Unmounting the VHD...
Summary: Errors: 0, Warnings: 0, Successes: 1
INFO: Done.
D:\Documents\Scripts>diskpart
Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: SAVDALWKS01
DISKPART> select vdisk file=d:\temp\win7hpstd.vhd
DiskPart successfully selected the virtual disk file.
DISKPART> attach vdisk
100 percent completed
DiskPart successfully attached the virtual disk file.
DISKPART> assign letter=w
DiskPart successfully assigned the drive letter or mount point.
DISKPART> list vol
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 H DVD-ROM 0 B No Media
Volume 1 G EDGE_OF_DAR UDF DVD-ROM 6968 MB Healthy
Volume 2 System Rese NTFS Partition 100 MB Healthy System
Volume 3 C NTFS Partition 148 GB Healthy Boot
Volume 4 T Temp NTFS Partition 74 GB Healthy Pagefile
Volume 5 V Virtuals NTFS Partition 279 GB Healthy
Volume 6 D Data NTFS Partition 1396 GB Healthy
Volume 7 Removable 0 B No Media
* Volume 8 W NTFS Partition 39 GB Healthy
DISKPART> exit
Leaving DiskPart...
D:\Documents\Scripts>dism /image:w:\ /get-currentedition
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
Current edition is:
Current Edition : HomePremium
The operation completed successfully.