Windows 7 has native support for VHD mounting. Either use Disk Management from the Admin tools or diskpart utilitiy from command line.
To mount a VHD file in scripts using diskpart.
- Create a text file with this content:
SELECT VDISK FILE=”filename.vhd”
ATTACH VDISK
2. To attach the VHD image in a script, Use: “diskpart -s scriptfile”
For example:
Master file: VHDMount.cmd
diskpart -s "C:\Scripts\Mount.s"
Mount.s:
SELECT VDISK FILE="C:\DataVHD\ImageVHD.vhd"
ATTACH VDISK