Batch per obtenir data en una variable

Aquest Batch està optimitzat per un Windows 2003

echo on
@REM Quick date batch (MMDDYYYY format)
@REM Setups %date variable
@REM First parses month, day, and year into mm , dd, yyyy formats and then combines to be MMDDYYYY
FOR /F “TOKENS=1,2 eol=/ DELIMS=/ ” %%A IN (‘DATE/T’) DO SET mm=%%B
FOR /F “DELIMS=/” %%A IN (‘DATE/T’) DO SET dd=%%A
FOR /F “TOKENS=2,3 DELIMS=/ ” %%A IN (‘echo %CDATE%’) DO SET yy=%%B
SET date=%mm%%dd%%yy%

Que t'ha semblat?
[Total: 0 Mitjana: 0]