Get the Date Information for your batch file. If you like me still need to create DOS batch file to automate some jobs in the server give this a try.
%DATE% is the environment variable which you can use to return the date in the batch file, you can format it by extract the YEAR, MONTH and DAY using this command %DATE:~[BeginPos],[NoOfChar]% (it’s like substring command). Example;
Please take note that the return date format are according to the system Regional Settings.
For those using Windows NT more information are available in link below
According to the web site above the %DATE% variable suppose to work in NT SP6a but I dunno why it did not work in mine. So I have to use the format below;
FOR /F “TOKENS=*” %%A IN (’TIME/T’) DO SET TIME=%%A
ECHO It’s %TIME% now