Usually, date
variable in batch file contains:
The first three letters of the day today (but in some systems this does not exist).
The date today (formats are different per system) [numbers are usually seperated by /
symbol which is interpreted as directory separator].
This way creates a datestamp with mmddyy
format IN CMD:
for /f "tokens=2 delims==" %A in ('wmic OS Get localdatetime /value') do set "dt=%A"
set "YY=%dt:~2,2%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
rem M=month D=day Y=Year
set datestamp=%MM%%DD%%YY%
rem Change datestamp variable as you want.
ren "CEEMEA & LATAM.Docx" "CEEMEA & LATAM %datestamp%.Docx"
Note: The above code is only for cmd. If you want it for a batch file double the percent signs (%) of the loop variables (%A
should become %%A
in both two cases).