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.

101 lines
3.3 KiB

  1. @rem ======================================================================
  2. @rem ======================================================================
  3. @rem
  4. @rem Microsoft Windows
  5. @rem
  6. @rem Copyright (c) Microsoft Corporation, 1996 - 1997
  7. @rem
  8. @rem File: initperf.cmd
  9. @rem
  10. @rem Contents: create performance files.
  11. @rem
  12. @rem History: 05-Oct-1997 pberkman created
  13. @rem
  14. @rem ======================================================================
  15. @rem ======================================================================
  16. @echo off
  17. @SETLOCAL ENABLEEXTENSIONS
  18. @set __LOG=..\initperf.log
  19. @cd fileset
  20. @if "%COMPUTERNAME%" == "" @set COMPUTERNAME=perf
  21. @if exist tcatnt.fil @del tcatnt.fil
  22. @if exist tcatnt.cat @del tcatnt.cat
  23. @if exist tcatnt.cdf @del tcatnt.cdf
  24. @if exist tsystem.dir @del tsystem.dir
  25. @if exist %SystemRoot%\System32\CatRoot rmdir /s /q %SystemRoot%\System32\CatRoot
  26. @goto AddCDFHeader
  27. @rem ======================================================================
  28. :AddCDFHeader
  29. @rem ======================================================================
  30. echo [CatalogHeader]> tcatnt.cdf
  31. echo Name=tcatnt.cat>> tcatnt.cdf
  32. echo CATATTR1=0x10010001:OSAttr:1:4.x,2:4.x,2:5.x>> tcatnt.cdf
  33. echo [CatalogFiles]>> tcatnt.cdf
  34. @goto AddFiles2CDF
  35. @rem ======================================================================
  36. :AddFiles2CDF
  37. @rem ======================================================================
  38. @dir /b /A-D-R /L /Oen %SystemRoot%\System32\*.* > tsystem.dir
  39. FOR /F "delims=;" %%i IN (tsystem.dir) DO call :Add2CDFFile "%%i"
  40. @stripqts tcatnt.cdf
  41. @goto CreateCAT
  42. @rem ======================================================================
  43. :CreateCAT
  44. @rem ======================================================================
  45. @makecat -v tcatnt.cdf >> %__LOG%
  46. @goto SignCAT
  47. @rem ======================================================================
  48. :SignCAT
  49. @rem ======================================================================
  50. @signcode -v driver.pvk -spc driver.spc -n "Performance" -i "http://pberkman2" -t "http://timestamp.verisign.com/scripts/timstamp.dll" -tr 10 -tw 2 tcatnt.cat >> %__LOG%
  51. @goto FinishInit
  52. @rem ======================================================================
  53. :Add2CDFFile
  54. @rem ======================================================================
  55. @rem
  56. @rem %1: drive, path, and file
  57. @rem %2: drive and path
  58. @rem %3: file and ext only
  59. @rem %4: file only
  60. @rem
  61. @echo processing: 1=%1 >> %__LOG%
  62. @if not exist "%SystemRoot%\System32\%1" @goto :Error_Loop
  63. echo %1=%SystemRoot%\System32\%1>>tcatnt.cdf
  64. @goto :EOF
  65. @rem ======================================================================
  66. :Error_Loop
  67. @rem ======================================================================
  68. echo unable to process %1 >> %__LOG%
  69. @goto :EOF
  70. @rem ======================================================================
  71. :FinishInit
  72. @rem ======================================================================
  73. cd ..
  74. @ENDLOCAL