Here is a helper batch file that will do what you want. To rename and rename a file with an added date, one parameter is required. Hope this helps.
@echo off
setlocal
if "%1"=="" goto USAGE
set file_name=%1
set name=%~n1
set ext=%~x1
dir %file_name% | findstr /i %file_name% > y.tmp
for /f "tokens=*" %%i in (y.tmp) do (
set line=%%i
)
del y.tmp
set month=%line:~0,2%
set day=%line:~3,2%
set year=%line:~6,4%
ren %file_name% %name%_%year%%month%%day%%ext%
goto EOF
:USAGE
echo %0 file_name
:EOF
endlocal
source
share