set count=1
set tep="D:\Program Files\proeWildfire 3.0\templates\edm_mmgs.prt"
for /f "tokens=1 delims=." %%i in ('dir /a-d /b ^|findstr asm') do (
set mname=%%i
goto:makefile
)
:makefile
if "%mname%"=="" goto:eof
if not exist %mname%_%count%.prt* (
copy %tep% %mname%_%count%.prt>nul
goto:eof) else (
set /a count=count+1
goto:makefile
)