Posted - 12/01/2008 : 21:07:59
| Hello - I new to this forum so please let me know if I am posting this question in the wrong area or if batch file questions are off topic.
I am trying to append current date to file via batch. The below script is working although, in the past this same script has worked as expected. This time I am running the script on an EU server, perhaps the date format needs to be reformatted? Suggestions greatly appreciated.
cd cd C:\***yourfilepath here***
REM *** Create variables for mm, dd, yyyy ***
FOR /f "tokens=2" %%i in ('date /t') do set thedate=%%i
REM *** use date to build XYZ filename ***
REM *** rename reports ***
ren XYZ XYZ_%yyyy%%mm%%dd%.PDF