When working in a Bash environment, to set the value of a variable as the result of a command, I usually do:
var=$(command -args)
where var is the variable set by the command command -args. I can then access that variable as $var.
A more conventional way to do this which is compatible with almost every Unix shell is:
set var=`command -args`
That said, how can I set the value of a variable with the result of a command in a Windows batch file? I've tried:
set var=command -args
But I find that var is set to command -args rather than the output of the command.
