I have a script that inside a virtual machine I'm able to trigger.
However, I'd like to pass the argument to the script. I'd normally run the script as ">>test.bat user1"
The arguement is "user1". Can someone help modify the below command to pass the arguement?
VBoxManage --nologo guestcontrol "sample1" run --exe "C:\Users\sample1\Desktop\test.bat" --username sample1 --password sample2 --wait-stdout
I also tried running
VBoxManage --nologo guestcontrol "sample1" run --exe "C:\Users\sample1\Desktop\test.bat user1" --username sample1 --password sample2 --wait-stdout
But it was not right, I had results for above command as :
C:\Program Files\Oracle\VirtualBox>VBoxManage --nologo guestcontrol "sample3" run --exe "C:\Users\sample1\Desktop\test.bat user1" --username sample1 --password sample2 --wait-stdout
VBoxManage.exe: error: No such file or directory on guest
VBoxManage.exe: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component GuestProcessWrap, interface IGuestProcess, callee IUnknown
VBoxManage.exe: error: Context: "WaitForArray(ComSafeArrayAsInParam(aWaitStartFlags), gctlRunGetRemainingTime(msStart, cMsTimeout), &waitResult)" at line 1485 of file VBoxManageGuestCtrl.cpp
Also tried
VBoxManage --nologo guestcontrol "sample1" run --exe "C:\Users\sample1\Desktop\test.bat" --username sample1 --password sample2 --wait-stdout --user1
Usage:
VBoxManage guestcontrol <uuid|vmname> [--verbose|-v] [--quiet|-q]
[--username <name>] [--domain <domain>]
[--passwordfile <file> | --password <password>]
run [common-options]
[--exe <path to executable>] [--timeout <msec>]
[-E|--putenv <NAME>[=<VALUE>]] [--unquoted-args]
[--ignore-operhaned-processes] [--profile]
[--no-wait-stdout|--wait-stdout]
[--no-wait-stderr|--wait-stderr]
[--dos2unix] [--unix2dos]
-- <program/arg0> [argument1] ... [argumentN]]
VBoxManage.exe: error: Unknown option: --user1