Powered by GeSHi

Source code for checkdst.bat

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

  1. @ECHO OFF
  2. :: Check Windows version
  3. IF NOT "%OS%"=="Windows_NT" GOTO Syntax
  4.  
  5. :: Check command line arguments -- none required
  6. IF NOT "%~1"=="" GOTO Syntax
  7.  
  8. :: Display header -- on screen only
  9. >CON ECHO Computers without automatic DST adjustment:
  10.  
  11. :: Find active computers without DST adjustment
  12. FOR /F %%A IN ('NET.EXE VIEW ^| FIND.EXE "\\"') DO (
  13. 	FOR /F "tokens=5 delims=\ " %%B IN ('NET.EXE TIME %%A 2>NUL ^| FIND.EXE "Local time"') DO (
  14. 		ECHO.%%B
  15. 	)
  16. )
  17.  
  18. :: Done
  19. GOTO:EOF
  20.  
  21.  
  22. :Syntax
  23. ECHO.
  24. ECHO CheckDST.bat,  Version 1.00 for Windows NT 4 and later
  25. ECHO Check which active computers don't have automatic DST adjustment.
  26. ECHO.
  27. ECHO Usage:  CHECKDST
  28. ECHO.
  29. ECHO Note:   This check should only be performed during DST,
  30. ECHO         otherwise the list will be empty.
  31. ECHO.
  32. ECHO Written by Rob van der Woude
  33. ECHO http://www.robvanderwoude.com
  34.