Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for scheduld.bat

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

  1. @ECHO OFF
  2. (ECHO.) 1>&2
  3.  
  4. :: Check for required tool, Windows version, command line arguments
  5. IF NOT [%1]==[] GOTO Syntax
  6. IF NOT "%OS%"=="Windows_NT" GOTO Syntax
  7. VER | FIND "Windows 2000" >NUL
  8. IF ERRORLEVEL 1 GOTO Syntax
  9. STRINGS.EXE >NUL 2>&1
  10. IF ERRORLEVEL 1 GOTO Syntax
  11.  
  12. :: Display header
  13. (ECHO Scheduled tasks on %ComputerName%:) 1>&2
  14. (ECHO ^(Command, [ Arguments, ] [ Working dir, ] Creator^)) 1>&2
  15. (ECHO.) 1>&2
  16.  
  17. :: List all tasks and their properties
  18. FOR %%A IN ("%windir%\Tasks\*.job") DO (
  19. 	ECHO.%%~nA
  20. 	ECHO.===============================================================================
  21. 	STRINGS.EXE "%%~fA" | MORE /E +5
  22. )
  23.  
  24. :: Done
  25. GOTO End
  26.  
  27.  
  28. :Syntax
  29. (ECHO Scheduld.bat,  Version 1.00 for Windows 2000) 1>&2
  30. (ECHO List all scheduled tasks and some of their properties) 1>&2
  31. (ECHO.) 1>&2
  32. (ECHO Usage:  SCHEDULD  [ /? ]) 1>&2
  33. (ECHO.) 1>&2
  34. (ECHO Requires SysInternals' STRINGS.EXE, available at) 1>&2
  35. (ECHO http://www.sysinternals.com/ntw2k/source/misc.shtml#Strings) 1>&2
  36. (ECHO.) 1>&2
  37. (ECHO Written by Rob van der Woude) 1>&2
  38. (ECHO http://www.robvanderwoude.com) 1>&2
  39.  
  40.  
  41. :End
  42.  

page last uploaded: 2017-08-21, 14:26