Page 1 of 1

If check variable

Posted: 13 Apr 2010 10:35
by radcaesar
My varFileCount is 10, but the echo message not displayed.

Where am I missing? Please....

dir "c:\MCSLoad\*.txt" | find /c ".txt" >> filecount.txt
set /P varFileCount=<filecount.txt
del filecount.txt
if NOT %varFileCount% == 20(
echo File Count Not Match
)

Re: If check variable

Posted: 13 Apr 2010 11:01
by radcaesar
Sorted it out using GOTO.

Thanks...

Re: If check variable

Posted: 13 Apr 2010 11:16
by !k
Use if NOT "%varFileCount%" == "20" (
or if NOT _%varFileCount% == _20 (
or if NOT [%varFileCount%] == [20] (
or...

and be sure to use a space before the parenthesis / next command