I thought that in NT, the receiving end of an anonymous pipe is launched in a separate child process, so any environment changes will not survive, so, BC_Programmer, how did you get the pipe method to work?
Hmm, Not sure. Not sure how I had it working either, maybe it just appeared to work; I was messing about with the commandline seeing how I could force the contents of the file to be the stdin of set /p and I figured I do it with more, may as well give piping a shot. No idea how it worked, must have been a fluke and I had set a variable to the same value I was expecting (
). I believe it's true though, that as far as the | is involved each program is given a inherited environment. (it was my understanding that they could inherit a handle to the same environment, and thus change the values within it... but I suppose cmd doesn't do that.
redirection works, and it's shorter, too.
What I did probably stems from when I used "ANSWER.com" to perform input queries in Pure DOS; since it was a program using the pipe to force input wasn't really that esoteric. (And of course the fact that the environment block was relatively unchanged for the execution of any number of programs was a big plus).