Translations:Pdate/12/en

From SysadminWiki.ru
Jump to: navigation, search

Here is a script to build a date-based file name:

rem --- set and get variable %dm% with current date ---
pdate.exe "\s\e\t \d\m\=Y.M.d" >tmp.bat
call tmp.bat
del tmp.bat
set FileName=name_%dm%.log

For September 1st we will get variable FileName equal to name_2007.09.01.log.