2011-04-21

2011-04-21 可恨的Windows bat script!!!!!


REM Set Date format
FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
SET date=%yyyy%%mm%%dd%


點解M$甚麼的bat script print YYYYMMDD的date format也要用上4個for loop!!!! 理解不能!!!!

沒有留言:

張貼留言

Please post your comments. =]