VirtualPC VB Script

Here some usefull scripts:

Disable timesync for a VM

'Title: Script to disable timesync for a VM. 

'Usage: cscript ScriptName <vmname> 
Set objVPC = CreateObject("VirtualPC.Application") 

'Get virtual machine name from command-line parameter 
Set objVM = objVPC.FindVirtualMachine(WScript.Arguments(0)) 

'Disable TimeSync During Boot Time
errReturn  = objVM.SetConfigurationValue("hardware/bios/time_sync_at_boot",false)

'Get object for GuestOS
Set objGuestOS =objVM.GuestOS

'Disable TimeSync During VM Execution
objGuestOS. IsHostTimeSyncEnabled = false

Attach floppy drivers

Set objVPC = CreateObject("VirtualPC.Application")

Set objVM = objVPC.FindVirtualMachine("name of the VM")

Set colFloppyDrives = objVM.FloppyDrives

For Each objDrive in colFloppyDrives

    retVal = objDrive.AttachImage("path of vfd file")

Next

Release floppy drives

Set objVPC = CreateObject("VirtualPC.Application")

Set objVM = objVPC.FindVirtualMachine("name of the VM")

Set colFloppyDrives = objVM.FloppyDrives

For Each objDrive in colFloppyDrives

    retVal = objDrive.ReleaseImage()

Next

…Hope this helps.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s