Can you redirect the output of a command to a variable with pipes?
I haven\'t tried much as I haven\'t been able to think of anything to try, but I have tried one me
In a batch file I usually create a file in the temp directory and append output from a program, then I call it with a variable-name to set that variable. Like this:
:: Create a set_var.cmd file containing: set %1=
set /p="set %%1=""%temp%\set_var.cmd"
:: Append output from a command
ipconfig | find "IPv4" >> "%temp%\set_var.cmd"
call "%temp%\set_var.cmd" IPAddress
echo %IPAddress%