Let's all put our hands together and give another shout out to Ben Armstrong as he comes through once again with another fantastic idea and code snippet to make our virtual lives, just a little bit easier.
This time, Ben helps answer, using Virtual Server or Virtual PC, how do I remotely and programmatically start a program running inside of a virtual machine? Although the product doesn't do it natively, Ben suggests you can do it using the built in support in Windows. The following script will open a copy of notepad on a remote computer:
strComputer = "NameOrIPAdressOfVirtualMachine"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2:Win32_Process")
Error = objWMIService.Create("notepad.exe", null, null, intProcessID)
If Error = 0 Then
Wscript.Echo "Notepad was started with a process ID of " _
& intProcessID & "."
Else
Wscript.Echo "Notepad could not be started due to error " & _
Error & "."
End If
And in order to do this you will need to follow the same network configuration as discussed in one of his previous articles: http://blogs.msdn.com/virtual_pc_guy/archive/2006/03/02/541124.aspx
To read Ben's original post and thank him or leave him a comment, go here.