Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
3.1 KiB

  1. @echo off
  2. @rem ======================================================================
  3. @rem ======================================================================
  4. @rem
  5. @rem Microsoft Windows
  6. @rem
  7. @rem Copyright (c) Microsoft Corporation, 1996 - 1997
  8. @rem
  9. @rem File: startsgn.bat
  10. @rem
  11. @rem Contents: Microsoft PRS Signing Utilities
  12. @rem
  13. @rem History: 20-Aug-1997 pberkman created
  14. @rem
  15. @rem ======================================================================
  16. @rem ======================================================================
  17. @SETLOCAL ENABLEEXTENSIONS
  18. @set __OLDPATH=%PATH%
  19. @set PATH=\CryptSDK\Bin;%PATH%
  20. @set __INPUTFILE=LIST.TXT
  21. @set __ECHOON=
  22. @set __TEST=
  23. @set __CHECK=
  24. @set __SIGNFLAGS=
  25. @if "%COMPUTERNAME%" == "" @set COMPUTERNAME=TEST
  26. @rem ======================================================================
  27. @rem check command line
  28. @rem ======================================================================
  29. :CheckCmdLine
  30. @if "%1" == "" goto FindSubDirs
  31. @if /I "%1" == "-?" goto HelpMe
  32. @if /I "%1" == "/?" goto HelpMe
  33. @if /I "%1" == "-v" @set __ECHOON=TRUE
  34. @if /I "%1" == "/v" @set __ECHOON=TRUE
  35. @if /I "%1" == "-c" @set __CHECK=TRUE
  36. @if /I "%1" == "/c" @set __CHECK=TRUE
  37. @if /I "%1" == "-T" @set __TEST=TRUE
  38. @if /I "%1" == "/T" @set __TEST=TRUE
  39. @shift
  40. @goto CheckCmdLine
  41. @rem ======================================================================
  42. @rem help
  43. @rem ======================================================================
  44. :HelpMe
  45. @echo Usage: %0 [-v, -c, -t]
  46. @echo parameters (optional)
  47. @echo -v: verbose
  48. @echo -c: run chktrust on each file
  49. @echo -t: use test sign
  50. @goto end_startsgn
  51. @rem ======================================================================
  52. @rem find subdirs
  53. @rem ======================================================================
  54. :FindSubDirs
  55. @if "%__ECHOON%" == "TRUE" @echo on
  56. @if "%__ECHOON%" == "TRUE" @set __SIGNFLAGS=%__SIGNFLAGS% -v
  57. @if "%__TEST%" == "TRUE" @set __SIGNFLAGS=%__SIGNFLAGS% -t
  58. @if "%__CHECK%" == "TRUE" @set __SIGNFLAGS=%__SIGNFLAGS% -c
  59. @dir /ad /b > %COMPUTERNAME%.DIR
  60. FOR /F %%i IN (%COMPUTERNAME%.DIR) DO call :CallSignFiles %%i
  61. @goto end_startsgn
  62. @rem ======================================================================
  63. @rem do the actual call
  64. @rem ======================================================================
  65. :CallSignFiles
  66. @echo Processing: %1
  67. @cd %1
  68. @if not exist "%__INPUTFILE%" @goto end_call
  69. @call ..\SIGNFILES.BAT %__SIGNFLAGS% -!
  70. :end_call
  71. @cd ..
  72. @goto :EOF
  73. :end_startsgn
  74. @set PATH=%__OLDPATH%
  75. @set ___OLDPATH=
  76. @set __INPUTFILE=
  77. @set __ECHOON=
  78. @set __TEST=
  79. @set __CHECK=
  80. @set __SIGNFLAGS=
  81. @if exist %COMPUTERNAME%.DIR del /q %COMPUTERNAME%.DIR