Tech: Converting Microsoft Virtual Server 2005 virtual hard disk

Ben Armstrong provided a cool script to convert Virtual Server 2005 virtual hard disks (.vhd) from dynamical to fixed size:

set vsApp = CreateObject(“VirtualServer.Application”,”localhost”)

TargetVHDpath =Inputbox(“Enter path and name of VHD to convert:”)
FixedVHDpath =Inputbox(“Enter path and name of VHD to create”)

set target = vsApp.GetHardDisk(TargetVHDpath)

set convertTask = target.convert(FixedVHDpath,1)

while not convertTask.isComplete
wscript.echo “Conversion is ” & convertTask.PercentCompleted & “% complete”
WScript.Sleep 2000
wend

wscript.echo
wscript.echo “Conversion complete”

Be sure to read the original post for updates and comments.