I need the result of a command to be taken as a parameter in another command.
command /opt <another command output>
On Bash Linux I would do
command /opt `another command`
What is the equivalent of the ` symbol that works in Windows Terminal?
In particular, I am using the command
'C:\Program Files\Display\display64.exe' /listdevices | findstr 22MP55 | %{$_ -replace "- .*",""}
where findstr
is the windows equivalent to grep
and the final command in the pipe is the equivalent to sed
. The output of this command will be 1, 2 or 3, and I need this to be passed to the %HERE
in the following line
'C:\Program Files\Display\display64.exe' /device %HERE /rotate 90
The following minimal example, does not work:
FOR /F %a in ('"C:\Program Files\Display\display64.exe" /listdevices | findstr 22MP55 | %{$_ -replace "- .*",""}') do echo "%a"
What I am doing wrong? (I am new in Windows).