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
)
If check variable
Moderator: DosItHelp
Re: If check variable
Sorted it out using GOTO.
Thanks...
Thanks...
Re: If check variable
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
or if NOT _%varFileCount% == _20 (
or if NOT [%varFileCount%] == [20] (
or...
and be sure to use a space before the parenthesis / next command