Opened 3 years ago
#20204 new defect
My VBoxManage-code, runned on the host, can not bring a "windows guest registry value" into my guestproperty
Reported by: | wemido | Owned by: | |
---|---|---|---|
Component: | guest control | Version: | VirtualBox 6.1.14 |
Keywords: | VBoxManage, guestcontrol, setproperty | Cc: | |
Guest type: | Windows | Host type: | Linux |
Description
I try to get a registry value of the guest with a command that runs in the host. But this does not work.
To get a better idea of the problem, I have checked parts of my code separately.
First I have tested the command in the windows guest. Result: It works.
Here is the command: I go into my Windows 7 guest. I open the cmd-window. I type in the cmd-window the following inclusive <"> .
"%SystemRoot%\system32\cmd.exe" -- 'cmd' /c start "run this" For /F "EOL=H Tokens=2,*" %G In ('""%SystemRoot%\System32\reg.exe" Query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice" /V "ProgId" 2> NUL"') Do @"D:\NT3x\VBoxControl.exe" --nologo guestproperty set /myproperties/myproperty "%H"
To be sure, that it has worked, I go back to my Linux host and type in a terminal the following:
VBoxManage guestproperty get "MyWin7Guest" /myproperties/myproperty
Output:
Value: Word.Document.12
After, I now change the guestproperty (so that I can use it later again) with the command:
VBoxManage guestproperty set "MyWin7Guest" /myproperties/myproperty "deleted"
Now I create a variable of the code above, (but not of the whole one, please compare them) because I need it later. I do this in a linux terminal in my Linux host:
q='For /F "EOL=H Tokens=2,*" %G In (' w="'" e='""%SystemRoot%\System32\reg.exe" Query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice" /V "ProgId" 2> NUL"' r="'" t=') Do @"D:\NT3x\VBoxControl.exe" --nologo guestproperty set /myproperties/myproperty "%H"' p=$q$w$e$r$t
So I have the code above in $p. I need this later:
$ echo $p For /F "EOL=H Tokens=2,*" %G In ('""%SystemRoot%\System32\reg.exe" Query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice" /V "ProgId" 2> NUL"') Do @"D:\NT3x\VBoxControl.exe" --nologo guestproperty set /myproperties/myproperty "%H"
As the code has worked in my guest-system, I can now go one step further. I'll put the following code in front of it:
VBoxManage guestcontrol "MyWin7Guest" start --username XX --password YY --exe
So that I have now the following whole code:
VBoxManage guestcontrol "MyWin7Guest" start --username XX --password YY --exe "%SystemRoot%\system32\cmd.exe" -- 'cmd' /c start "run this" $p
I type this code into a terminal in my Linux host. Done. What is the output? No output. No error. It looks like this if the code had been executed correctly.
To be sure, that it has worked, I type in my Linux terminal the following:
VBoxManage guestproperty get "MyWin7Guest" /myproperties/myproperty
Here is the result:
$ VBoxManage guestproperty get "Win7NeuFurOfficeVersuch" /myproperties/myproperty Value: deleted
So: Why does this not work? Is this a VirtualBox error?