I know a way of doing this which is a bit like cheating but the code below creates a temporary file and then deletes it. I don't want that happen. So is there a proper or better way of doing it?
command 2>> "temp"
set /p OUTPUT=<"temp"
del "temp"
echo %OUTPUT%
I know there is a solution which uses for loop but that doesn't work for commands which return more than one line of result. I want to store all of them into my variable. (I tried this code btw)