hopefully any of the experts out there could help clear my suspicion...the 2 IF statements in my .bat file seem logiclly correct but it deosn't seem to work as I expected :

1) IF /I %varX% NEQ %varY%
2) IF NOT %varX%==%varY%

whereby the %varX% and %varY% are actually numeric digits extracted from a file (but numeric digits or not shouldn't matter as the /I should be taking care of it so the least case 1 should work...too bad it doesn't also :cry: )

:sad: looks so simple yet so complicated to code :mad: HELP :eek:

Hi,

This might show my ignorance to your situation, but what language are you programming in? I'm sure it might help somebody help you out here.

Have you tried:

IF NOT "%varX%" == "%varY%"

Have you tried:

IF NOT "%varX%" == "%varY%"

Hiya, yeah, i h've tried it too but doesn't seem to work either....i suspect it's unable to take care of the condition if say %varX% is blank. Cos' my .bat file is actually in this sequence :

FIND "Counter" d:\local.dat > d:\read.txt
FOR /F "tokens=3* delims=" %%i in (d:\read.txt) do set varX=%%i
IF NOT "%varX%" == "%varY%" echo Diff

whereby the IF statement doesn't work only when the %varX% is found to be blank due to the word "Counter" is not exist in d:\local.dat file. How can I handle this situation then? :o

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.