C:\\>type c:\\output.txt abcd C:\\>type c:\\output.txt | set /p V1= C:\\>set ... A bunch of junk, NOT seeing \"V1\"
What happened? According
The pipe seems to create a new CMD instance to carry out the next command that is receiving the pipe data. So when the pipe has concluded, that CMD instance exits and the variable is lost.