|Glad to hear you figured it out, however I would suggest redirecting before the echo rather than after:|
>> d:\counter.txt echo %count%
The reason for this is because:
echo %count% >> d:\counter.txt
Will leave <number><space> in the text file rather than just <number> and:
echo %count%>> d:\counter.txt
will result in the command processor interpreting the number as stream redirection. See http://judago.webs.com/batchoperato...
The main reason for this is because %variables% are treated exactly the same as code in the text file.