Erbl Posted August 31, 2008 Posted August 31, 2008 Hi all! Kinda new to all this. I have virtual PC and am trying to write a file that will open virtual PC and then hit the start button (Already selected) once the splash screen has gone. My aim is to be able to click just one icon and have it open and run my saved state VPC.... here is the code I'm using @echo off CD "C:\Program Files\Microsoft Virtual PC" "Virtual PC.exe" WinWaitActive("Virtual PC", "Virtual PC Console") ControlSend("Virtual PC Console", "", $controlID, "{Enter}") exit All this does is open VPC and that's it! Please help!
monoceres Posted August 31, 2008 Posted August 31, 2008 So, what language are you using? Autoit or batch? Broken link? PM me and I'll send you the file!
Erbl Posted August 31, 2008 Author Posted August 31, 2008 Well....... lol Wrote it in batch first, then moved to Autoit when I couldn't get batch to do it! lol! I guess I want it written in Autoit really....
APPLEEATER Posted August 31, 2008 Posted August 31, 2008 Well....... lol Wrote it in batch first, then moved to Autoit when I couldn't get batch to do it! lol! I guess I want it written in Autoit really.... It seams to me... that you either are waiting for the wrong window to be active, or you are trying to send the ENTER key to the wrong window... But if your window is Titled: Virtual PC Console, Then use this... RunWait("C:\Program Files\Microsoft Virtual PC\Virtual PC.exe", "C:\Program Files\Microsoft Virtual PC") WinWaitActive("Virtual PC Console") ControlSend("Virtual PC Console", "", $controlID, "{Enter}") Otherwise use this if your window name is: Virtual PC RunWait("C:\Program Files\Microsoft Virtual PC\Virtual PC.exe", "C:\Program Files\Microsoft Virtual PC") WinWaitActive("Virtual PC") ControlSend("Virtual PC", "", $controlID, "{Enter}") Hope this is helping...
Erbl Posted August 31, 2008 Author Posted August 31, 2008 OK! So it was just TO easy! Feel like a total N00B! (which I am!) Code was simple when I thought about it and started from scratch.... Run ("C:\Program Files\Microsoft Virtual PC\Virtual PC.exe") WinWaitActive("Virtual PC Console") Send("{ENTER}")
herewasplato Posted September 1, 2008 Posted September 1, 2008 Incase you are interested in the way to use Controls to make this happen:Run("C:\Program Files\Microsoft Virtual PC\Virtual PC.exe", "C:\Program Files\Microsoft Virtual PC") WinWaitActive("Virtual PC Console") Do Sleep(9) Until ControlCommand("Virtual PC Console", "", "Button2", "IsEnabled", "") ControlSend("Virtual PC Console", "", "Button2", "{Enter}")"Button2" is the start button, which is not enabled right away. If you get into more complicated VM needs, VirtualBox has a GUI interface kind of like the MS VPC and it has a command line exe that can start a VM with lots of options. [size="1"][font="Arial"].[u].[/u][/font][/size]
Erbl Posted September 1, 2008 Author Posted September 1, 2008 Thanks Herewas! Will have a look at VirtualBox... Just about to have a play with VMware first...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now