我有一个可以在虚拟机中触发的脚本。
但是,我想将参数传递给脚本。我通常将脚本作为“>>test.bat user1”运行
争论是“user1”。有人可以帮助修改以下命令以通过争论吗?
VBoxManage --nologo guestcontrol "sample1" run --exe "C:\Users\sample1\Desktop\test.bat" --username sample1 --password sample2 --wait-stdout
我也试过跑步
VBoxManage --nologo guestcontrol "sample1" run --exe "C:\Users\sample1\Desktop\test.bat user1" --username sample1 --password sample2 --wait-stdout
但这是不对的,我对上述命令的结果为:
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
也试过
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