Set variable from (single-line) file

April 26, 2010 at 02:50:53
Specs: Windows XP
Hello there. I have a file called temp.tmp which contains a single number - either 0 or 1 to be precise. What I want to do is to have batch file to read that number into a variable, but after searching far and wide I can't find a way that would work.

Perhaps someone here can help me? Thanks in advance.


See More: Set variable from (single-line) file

Report •


#1
April 26, 2010 at 03:08:11

set /P myvar=< "temp.tmp"


Report •

#2
April 26, 2010 at 03:13:42
Deleted, beaten to the punch.

Report •

#3
April 26, 2010 at 03:25:35
Works, thanks :)

Report •
Related Solutions


Ask Question