问题
Is there a way to interact with Virtual PC1?
Looking to do basic things like startup and shutdown (with choice of save or turn off etc..) specific VM's.
Any solution other than simulating key presses would be fine, for example
- WMI
- COM+
- ADSI
- PowerShell
1 - Specifically for Virtual PC as in Microsoft Virtual PC (i.e. the one that runs on Vista and earlier), not Windows Virtual PC (i.e. the Win7 one)
回答1:
Alas, no, see http://www.aspdeveloper.net/Virtual_PC/rn-739-16434_Virtual_PC_API.aspx .
回答2:
It's not quite what you're after but there are a whole set of command line parameters you can use on Virtual PC.exe to start and pause VMs as well as set screen modes and disable/enable various options.
You can find them on this MS KB 831501 article.
"Virtual PC.exe" [-singlepc] [-quiet] [-usehostdiskcache] [-pc virtual_machine_name [-disableclose] [-disableopt] [-s3bitclip] [-setbiosno bios_serial_number] [-setassettag asset_tag] [-extnetworking] [-launch] [{-fullscreen|-window}] [-geometry widthxheight{+|-}x offset{+|-}y offset] [{-minimize|-restore}] [{-pause|-resume}]] [-help] [-registervm filename.vmc] [-startvm filename.vmc]
来源:https://stackoverflow.com/questions/892978/is-there-a-way-api-scripting-to-work-with-virtual-pc