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
To add a brief example of how to confirm the other answers, you can immediately check the contents of the variable on the other side of the pipe using another set command IE:
ECHO HELLO | (set /P hi= && set hi)
Will output
hi=HELLO
But after execution the variables are destroyed : (, so a further 'set hi' will reveal:
Environment variable hi not defined