I\'ve spent the past 3hrs trying to work this out but just couldn\'t find a solution. Here\'s my batch script:
if NOT Exist Counter.txt GOTO START
Type c:\\count
I realize you've found another answer - but the fact is that your original code was nearly correct but for a syntax error.
Your code contained the line
set /A COUNTER=%COUNTER%+1
and the syntax that would work is simply...
set /A COUNTER=COUNTER+1
See http://ss64.com/nt/set.html for all the details on the SET command. I just thought I'd add this clarification for anyone else who doesn't have the option of using FreeDOS.