how to compare the variables...

December 30, 2010 at 23:20:14
Specs: Windows XP, 1GHZ
I first created a file named "my.txt"
typed "hello" in the file.

Then created a bat file
Then typed the following contents


@echo off
setLocal EnableDelayedExpansion
set /p var=<my.txt
echo %var%
pause
set /p "comp=>"
echo %comp%
PAUSE
if "%var%"=="%comp%" echo success
pause


Then i entered "hello" when prompted for an input.

but i don't get output "SUCCESS" WHY IS IT.... ANY METHODS TO SOLVE IT PLZ HELP....




See More: how to compare the variables...

Report •


#1
December 31, 2010 at 03:16:40
change

set /p "comp=>"

to

set /p comp=string to compare?


=====================================
Life is too important to be taken seriously.

M2


Report •
Related Solutions


Ask Question