Read only 1st line. Don't need For Loop =)

October 26, 2010 at 23:45:48
Specs: Windows XP

I know it may seems simple for some but i need help.
Read only the 1st line in txt. Don't need for loop.
Example i've got a txt.. result.txt.
In the result.txt read : My Name is James Cardio.
Just want to put into a variable.
How do i get that?
Will it be something like ?

@echo off
set var=%%a

Thanks in advance =)

See More: Read only 1st line. Dont need For Loop =)

Report •

October 27, 2010 at 00:41:25
Set /p Var=<result.txt

Report •

October 27, 2010 at 00:57:10
My batch file goes..

@echo off
set /p var=<result.txt
echo !var!

My result was !var! . =)
Didn't get any reading from result.txt .
Any more advice please.

Report •

October 27, 2010 at 00:59:05
Okay i got it =p

It should be :

@echo off
set /p var=<result.txt
echo %var%

Report •

Related Solutions

Ask Question