Page 1 of 1

[SOLVED] How-to use guestcontol execute on shell commands?

Posted: 6. Jun 2011, 20:11
by Technologov
Hi All,

Host: Windows 7 x64, VBox 4.0.8
Guest: Windows XP

I did this:
> VBoxManage guestcontrol execute "Windows XP VM01" "ipconfig.exe" --arguments " /all" --username Administrator --password 123456 --wait-for stdout
..and this works.

But a similar command FAILs:
> VBoxManage guestcontrol execute "Windows XP VM01" "dir" --arguments " C:\" --username Administrator --password 1234
56 --wait-for stdout

The problem is that in Windows, 'dir' command is not a separate executable, unlike Linux 'ls', but is part of the system shell, "cmd.exe"

Any ideas?
-Technologov

Re: How-to use guestcontol execute on shell commands?

Posted: 6. Jun 2011, 20:22
by Leak
Technologov wrote:The problem is that in Windows, 'dir' command is not a separate executable, unlike Linux 'ls', but is part of the system shell, "cmd.exe"
That's your answer right there - run cmd.exe in the VM and pass "/c" (so it terminates) followed by whatever command(s) you want executed as it's arguments...

np: Death Cab For Cutie - State Street Residential (You Can Play These Songs With Chords)

Re: How-to use guestcontol execute on shell commands?

Posted: 6. Jun 2011, 20:44
by Technologov
Yes, and it doesn't work either:
C:\Program Files\Oracle\VirtualBox>VBoxManage guestcontrol execute "Windows XP VM01" "cmd.exe" --username Administrator --password 123456 --arguments " /c dir C:\" --wait-for stdout

update:
This works:
C:\Program Files\Oracle\VirtualBox>VBoxManage guestcontrol execute "Windows XP VM01" "cmd.exe" --username Administrator --password 123456 --arguments " /c dir C:\ >1" --wait-for stdout

Just had to redirect to STDOUT ! Thanks.

-Technologov

Re: How-to use guestcontol execute on shell commands?

Posted: 7. Jun 2011, 11:29
by mpack
@Leak - your contributions to this site are proving to be valuable, but your attention seeking sig is irritating: it is noise in an otherwise useful signal. I suggest you ditch it.