Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for date_errtime.bat

(view source code of date_errtime.bat as plain text)

  1. @ECHO OFF
  2. REM Use ERRTIME.EXE by Phil Money, Advantig LLC,
  3. REM for a sorted date (or time) in DOS batch files
  4. REM ERRTIME 1.4 is avalable at
  5. REM http://www.advantig.com/files/ErrTime14.zip
  6.  
  7. ERRTIME -y > NUL
  8.  
  9. FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %%A0 SET ERR10=%%A
  10. FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %ERR10%%%A SET ERR1=%%A
  11. SET YEAR=%ERR10%%ERR1%
  12.  
  13. ERRTIME -m > NUL
  14.  
  15. FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %%A0 SET ERR10=%%A
  16. FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %ERR10%%%A SET ERR1=%%A
  17. SET MONTH=%ERR10%%ERR1%
  18.  
  19. ERRTIME -d > NUL
  20.  
  21. FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %%A0 SET ERR10=%%A
  22. FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %ERR10%%%A SET ERR1=%%A
  23. SET DAY=%ERR10%%ERR1%
  24.  
  25. ECHO.
  26.  
  27. ECHO %YEAR%%MONTH%%DAY%
  28.  
  29. PAUSE

page last uploaded: 2017-04-06, 13:33