Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
This is weird. I am having a strange problem
I have a file which contains :---------- TEMP.TXT
CODEX=6I am trying to find the codex value.
In a batch file, i use this (suggested by Secret Doom)for /F "tokens=2 delims==" %%I in (T1.DAT) do (
echo %%I
IF %%I "==" ECHO UUUIJUI
if %I%=="6" echo six
)The for loop does not work at all for any string comparison. The "ECHO %%I" variable displays "6", but i cannot do any comaparison after that.
Please Help,
Kenny.

Let's see the comparisons one by one. First IF statement:
IF %%I "==" ECHO UUUIJUI
That will display the message "UUUIJUI" on the screen if %%I is nothing. Though that space between %%I and the first quote seems weird, it works. Perhaps that's not what you wanted it to do, but it makes what it is supposed to. Second IF statement:
if %I%=="6" echo six
It's %%I, not %I%. Another thing, it will only return a TRUE value (and execute the ECHO cmd) if %%I is "6", including the quotes. The file would have to contain, for instance:
CODEX="6"
I believe you wanted to do this:
if "%%I"=="6" echo six
That will execute the ECHO cmd if %%I is 6 (as in your example of TEMP.TXT).
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

![]() |
Can't install Win ME from...
|
olivetti jp190 dos driver...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |