Search This Blog

Friday 30 October 2009

batch script on Windows to get the current date

I've come across the need of getting the current date,
inside a batch file on Windows, here's how to do it:

FOR /f "tokens=1,2,3,4 delims=/ " %%a IN ('date /t') DO (
SET FileDate=%%c-%%b-%%a
)

echo executing backup in date %FileDate%

No comments:

Post a Comment