Hello All,
I am trying to append the current date to the end of the file name and I am using bat file script to do it. For example, I have the file 1.txt and when I use the script, the file name should be renamed as 1_29_09_2011.txt.
The script works good in Windows 7 and Windows 2003 Enterprise x64 Edition SP2.
However, for Windows 2003 Standard Edition SP2, the output I am receiving is 1_09-2011-.txt
The below are the contents of the bat file script:
for %%a in ("1.txt") do (
for /f "tokens=1-5 delims=/ " %%d in ("%date%") do rename "%%a" "%%~Na_%%e-%%f-%%g%%~Xa"
)
The OS version where I have issue is: Windows 2003 Standard Edition SP2.
Please help me in this regard. Thanks in advance.