As you can see I am new in the batch files, I have written a script in windows 2003 environment for print an increased value of the variable counter and also I have applied the if condition which is not working in the for loop, though outside the for it is showing the correct number of variable value.
@echo off
SetLocal EnableDelayedExpansion
cls
set /A counter = 1
for C:\Scripts\LogFiles\ %%a in (*.txt) do ( echo %counter%
set /A counter += 1
echo %%a
if %counter% ==2 (echo test)
)