Hello all together,
What's wrong with my command?
I type this into my linux-terminal:
This is the output:
The code has two parts:
The first part consists of this:
I use a VirtualBox VM. When my windows guest is running, then this VirtualBox command (typed into a Linux terminal in my Linux host) opens a cmd-window in the windows-guest. And it runs the cmd command, that follows <"run this">, in my guest. ("run this" will be the title of the cmd-window). This first part is bash-shell-code.
The second part consists of this:
This second part is not bash-shell, but cmd batch-code.
A)
The code of the second part is tested in the windows cmd-batch-window and it works. Concrete: When I open cmd in windows and type directly in, the cmd batch-code of the second part, then this code works.
--> This means the second part should work and is OK.
B)
The bash-shell-code of part 1 also works, when I take some other cmd-batch code for the second part. For example:
To be more concrete, when "winword.exe" follows to "run this" in part 1, then this combination of commands works. To be concrete: Running the whole command, consisting of part 1 and "winword.exe" as "part 2", in a Linux host terminal, starts Winword in the windows-guest.
--> This means the first part of the code also should work.
This looks like a contradiction: Each part works in some cases, but not in the combination I would like to have.
Would appreciate some help. Thank you.
What's wrong with my command?
I type this into my linux-terminal:
Code:
$ VBoxManage guestcontrol "NameOfMyVM" start --username UserNameOfMyWindowsLogin --password PasswordOfMyWindowsLogin --exe "%SystemRoot%\system32\cmd.exe" -- 'cmd' /k start "run this" "for /f "usebackq skip=1 tokens=3 delims= " %x in (`reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice" /v progid`) do set BUFFER=%x& call vboxcontrol guestproperty set /myproperties/myproperty %BUFFER:*Word=%"
This is the output:
Code:
bash: reg: Command not found
geifani@mx:~
$
The code has two parts:
The first part consists of this:
Code:
VBoxManage guestcontrol "NameOfMyVM" start --username UserNameOfMyWindowsLogin --password PasswordOfMyWindowsLogin --exe "%SystemRoot%\system32\cmd.exe" -- 'cmd' /c start "run this"
The second part consists of this:
Code:
"for /f "usebackq skip=1 tokens=3 delims= " %x in (`reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice" /v progid`) do set BUFFER=%x& call vboxcontrol guestproperty set /myproperties/myproperty %BUFFER:*Word=%"
A)
The code of the second part is tested in the windows cmd-batch-window and it works. Concrete: When I open cmd in windows and type directly in, the cmd batch-code of the second part, then this code works.
--> This means the second part should work and is OK.
B)
The bash-shell-code of part 1 also works, when I take some other cmd-batch code for the second part. For example:
Code:
"winword.exe"
--> This means the first part of the code also should work.
This looks like a contradiction: Each part works in some cases, but not in the combination I would like to have.
Would appreciate some help. Thank you.
Last edited: