I would like to iterate through some files. The difference in those files are just a number appended to it.
I want to do something like this –
SET /A COUNT=1
for %%I in (\\bay-e!COUNT!\e$\sat\logs\BAY-E!COUNT!.Log.2012-03- 12.log) do (
@echo %%~zI
SET /A COUNT+=1
)
I do not see this working. Is there any other way?
I assume you are on Windows.
The way to do it is something like
There are very useful unofficial Windows .BAT docs, here is the one for FOR/L: http://ss64.com/nt/for_l.html
Note: On the command line, use %G, only a .BAT file needs %%G