How to use the output of my first command in my second command in one step?
Posted: 13 Feb 2021 12:31
Hello all together,
(My system: Windows 7 Virtual Machine)
I have two commands.
The output of one command should be used for my other command.
-> But it does not work.
(cmd-window)
What is my first command inclusive output?
It is:
What is my second command?
it is:
This is the check, if the second command has really worked:
-> Yes the check is positive. It has worked. "MyText" is in the "myproperty".
I want, that the output of my first command is used as a replacement for "MyText" in my second command (... and so is saved in the property "myproperty").
Important:
It should be a direct way (in one step/in one line). Not create a first command line for putting the output into a variable and then create a second command line to put the content of this variable in my "myproperty".
Until now I have tried this variants. But all failed:
Question: How can I bring the output of "REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice" into my "myproperty" ?
Would appreciate some help. Thank you.
(My system: Windows 7 Virtual Machine)
I have two commands.
The output of one command should be used for my other command.
-> But it does not work.
(cmd-window)
What is my first command inclusive output?
It is:
Code: Select all
C:\>REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice
Progid REG_SZ Word.Document.12
What is my second command?
it is:
Code: Select all
C:\>D:\NT3x\vboxcontrol guestproperty set /myproperties/myproperty "MyText"
Oracle VM VirtualBox Guest Additions Command Line Management Interface Version 6.1.14
(C) 2008-2020 Oracle Corporation
All rights reserved.
Code: Select all
C:\>D:\NT3x\vboxcontrol guestproperty get /myproperties/myproperty
Oracle VM VirtualBox Guest Additions Command Line Management Interface Version 6.1.14
(C) 2008-2020 Oracle Corporation
All rights reserved.
Value: MyText
I want, that the output of my first command is used as a replacement for "MyText" in my second command (... and so is saved in the property "myproperty").
Important:
It should be a direct way (in one step/in one line). Not create a first command line for putting the output into a variable and then create a second command line to put the content of this variable in my "myproperty".
Until now I have tried this variants. But all failed:
Code: Select all
C:\>D:\NT3x\vboxcontrol guestproperty set /myproperties/myproperty REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersionExplorer\FileExts\.docx\UserChoiceoice
Code: Select all
C:\>D:\NT3x\vboxcontrol guestproperty set /myproperties/myproperty %REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersionExplorer\FileExts\.docx\UserChoiceoice%
Code: Select all
C:\>D:\NT3x\vboxcontrol guestproperty set /myproperties/myproperty echo REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersionExplorer\FileExts\.docx\UserChoiceoice
Code: Select all
C:\>D:\NT3x\REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersionExplorer\FileExts\.docx\UserChoiceoice | vboxcontrol guestproperty set /myproperties/myproperty
Question: How can I bring the output of "REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice" into my "myproperty" ?
Would appreciate some help. Thank you.