ASKER
ASKER
@echo off
setlocal enabledelayedexpansion
set source=E:\Module1\Module1a
set target=E:\images
set filename=header_copy.bmp
set counter=1
for /F "tokens=*" %%G in ('dir "%source%\%filename%" /A:-D /B /S') do (
set newname=!counter!
call :_rename
echo F| xcopy "%%G" "%target%\!newname!%%~xG" /C /H /R /Y /Z > NUL
set /a counter+=1
)
goto :eof
:_rename
if "!newname:~3,1!"=="" (
set newname=0!newname!
goto :_rename
)
goto :eof
ASKER
@echo off
setlocal enabledelayedexpansion
set source=E:\Module1a
set target=E:\images
set filename=header_copy.bmp
set counter=1
for /F "tokens=*" %%G in ('dir "%source%\%filename%" /A:-D /B /S') do (
set newname=!counter!
call :_rename
echo F| xcopy "%%G" "%target%\!newname!%%~xG" /C /H /R /Y /Z >
set /a counter+=1
)
pause
goto :eof
:_rename
if "!newname:~3,1!"=="" (
set newname=0!newname!
goto :_rename
)
goto :eof
ASKER
ASKER
Batch files are text files containing a script of commands that are executed by the command interpreter on DOS, OS/2 and Windows systems. Most commonly, they are used to perform a series of functions that are repeated -- copying a set of files created daily with one step, for example.
TRUSTED BY