Solved Assigning a type command's output as a variable.

October 30, 2013 at 23:54:01
Specs: Windows 8
I have a text file with the numbers "10" in it. If I send the command "type blah.txt" 10 comes out. My question is, how do I use the SET command to assign the output from this type command as a variable?

I thought, for example, that this would do it:
C:\>type blah.txt | SET certainnumber=
However, when I check, I get this.
C:\>ECHO %certainnumber%
How do I get the output from the type command to pipeline into the SET command?

message edited by link9454

See More: Assigning a type commands output as a variable.

Report •

October 31, 2013 at 00:04:21
✔ Best Answer
Scratch this, I figured it out. Rather then use the pipeline or anything like that, just use the text file itself.
SET /p certainnumber=<blah.txt

Report •
Related Solutions

Ask Question