If check variable

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
radcaesar
Posts: 4
Joined: 13 Apr 2010 08:52

If check variable

#1 Post by radcaesar » 13 Apr 2010 10:35

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
)

radcaesar
Posts: 4
Joined: 13 Apr 2010 08:52

Re: If check variable

#2 Post by radcaesar » 13 Apr 2010 11:01

Sorted it out using GOTO.

Thanks...

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Re: If check variable

#3 Post by !k » 13 Apr 2010 11:16

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

Post Reply