On Windows Server 2003
The following batch file below will rename a file called: filename.txt
*where date = todays date and is displayed as
MMDDYYYY (MM=Month DD = Day YYYY = year)
for %%a in ("filename.txt") do ren "%%~a" "%%~na%today:/=%%%~xa"
The batch file runs daily and will always rename the file to the today's date.
I need to display the date as YYYYMMDD (year month day) instead of MMDDYYYY.
so the file will be renamed filenameYYYYMMDD.txt. Any ideas on how to do this? Thanks.