I was trying to do something like
type test.txt | multiline.bat
with
test.txt
1
2
3
multiline.bat
set /p a=a
set /p "b=b"
set /p c=c
(echo %a% %b% %c%)>result.txt
pause
But result.txt was left with
1
when I expected
1 2 3
I found https://stackoverflow.com/a/6980605, which said
set /p doesn't work with pipes, it takes one (randomly) line from the input.
But why??