Thank you.
I have found out, how I must change the command, so that it uses <5% cpu.
Just replaced "run" through "start":
Code: Select all
[code]VBoxManage --nologo guestcontrol "Win7" start --exe "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" --username Plagrö --password 123456
[/code]
But now I have a new problem, I had not before.
The whole command is actually:
Code: Select all
VBoxManage startvm "Win7" && VBoxManage --nologo guestcontrol "Winl" run --exe "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" --username Plagrö --password 123456
This work, but with 60% cpu.
When I then replace "run" with "start":
Code: Select all
VBoxManage startvm "Win7" && VBoxManage --nologo guestcontrol "Winl" start --exe "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" --username Plagrö --password 123456
Then the VM starts, but not Excel.
But I found this contribution from you:
viewtopic.php?f=2&t=99261&p=481531&hili ... ol#p481536
Here you suggest to use guestproperty in a loop.
I am not a programmer. I only have made once some programmer steps in my pocket PC with the programmer language "Basic". It looks like Bash is way more complicated with variables. (= == -eq (()) () [] [[]] STR $STR "$STR"). I have tried hard to find out how to do this. But I was just not successful.
I have tried this:
Code: Select all
#!/bin/bash
VBoxManage startvm "Win7"
until [[ STR -eq 1 ]]
do
STR=VBoxManage guestproperty get "Win7" "/VirtualBox/GuestInfo/OS/LoggedInUsers"
sleep .01
done
VBoxManage --nologo guestcontrol "Win7" start --exe "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" --username Plagrö --password 123456
Output:
Code: Select all
Waiting for VM "Win7" to power on...
VM "Win7" has been successfully started.
/home/Plagrö/Desktop/Excel.sh: line 5: guestproperty: command not found.
---
STR=VBoxManage guestproperty get "Win7" "/VirtualBox/GuestInfo/OS/LoggedInUsers" works in a terminal without "STR=". But I need STR to make the test in "until". (?)
Thank you.