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.

218 lines
6.3 KiB

  1. @echo off
  2. REM FRSTRCK1.CMD - Tracks testing of FRS and captures log files.
  3. REM called with the base dir to store the log files and access utils.
  4. SETLOCAL ENABLEEXTENSIONS
  5. set FRSBASEDIR=%1
  6. if NOT EXIST c:\temp (md c:\temp)
  7. set FRS_SVC_LOGS=C:\TEMP\ntfrs*.*
  8. set FRS_SVC_LOGS2=%windir%\debug\ntfrs*.*
  9. set FRS_API_LOGS=%windir%\debug\ntfrsapi*.*
  10. set DCPROMO_LOGS=%windir%\debug\dcpromo*.*
  11. set LOGFILE=FRSA
  12. set LOGDIR=%FRSBASEDIR%\logs\%COMPUTERNAME%_%RANDOM%
  13. set LOG=%windir%\%RANDOM%.tmp
  14. set DEST=%LOGDIR%\STATUS.LOG
  15. set sys=%windir%\system32
  16. set UTILS=%FRSBASEDIR%\utils\%PROCESSOR_ARCHITECTURE%
  17. set idw=%windir%\idw
  18. md %LOGDIR%
  19. REM
  20. REM get the build number
  21. REM
  22. set xxbuildnum=%idw%\buildnum.exe
  23. if NOT EXIST !xxbuildnum! (
  24. set xxbuildnum=%utils%\buildnum.exe
  25. )
  26. FOR /F %%x IN ('!xxbuildnum! -b') DO set buildnum=%%x
  27. REM
  28. REM Get utilities from local IDW if present else
  29. REM try %FRSBASEDIR%\utils\%PROCESSOR_ARCHITECTURE%\%buildnum% else
  30. REM try %FRSBASEDIR%\utils\%PROCESSOR_ARCHITECTURE%
  31. REM
  32. for %%x in (nltest linkd regdmp du filever netdiag dstree frs tlist) do (
  33. set xx%%x=%idw%\%%x.exe
  34. if NOT EXIST !xx%%x! (
  35. set xx%%x=%utils%\%buildnum%\%%x.exe
  36. )
  37. if NOT EXIST !xx%%x! (
  38. set xx%%x=%utils%\%%x.exe
  39. )
  40. )
  41. echo 0, FRSTRACK, 1.2 >> %LOG%
  42. echo 1, %DATE%, %TIME%, %COMPUTERNAME%, %buildnum%, %PROCESSOR_ARCHITECTURE%, %NUMBER_OF_PROCESSORS% >> %LOG%
  43. echo 2, %SystemRoot%, %LOGONSERVER%, %USERDOMAIN%, %USERNAME% >> %LOG%
  44. echo 3, Path: %PATH% >> %LOG%
  45. echo 4, CD: %CD% >> %LOG%
  46. echo 5, %CMDEXTVERSION%, "%CMDCMDLINE%" >> %LOG%
  47. echo 6, >> %LOG%
  48. echo 7, >> %LOG%
  49. echo 8, >> %LOG%
  50. echo ...................... >> %LOG%
  51. echo 35, ProcessesRunning >> %LOG%
  52. %xxtlist% -s >> %LOG%
  53. echo 36, End ProcessesRunning >> %LOG%
  54. echo ...................... >> %LOG%
  55. echo 38, ServicesRunning >> %LOG%
  56. net start >> %LOG%
  57. echo 39, End ServicesRunning >> %LOG%
  58. echo Saving log files.
  59. echo ...................... >> %LOG%
  60. echo 48, %FRS_SVC_LOGS% >> %LOG%
  61. dir /od %FRS_SVC_LOGS% >> %LOG% 2>nul:
  62. dir /od %FRS_SVC_LOGS2% >> %LOG% 2>nul:
  63. echo 49, End %FRS_SVC_LOGS% >> %LOG%
  64. copy %FRS_SVC_LOGS% %LOGDIR% 1>nul: 2>nul:
  65. copy %FRS_SVC_LOGS2% %LOGDIR% 1>nul: 2>nul:
  66. copy %sys%\ntfrs.exe %LOGDIR% 1>nul: 2>nul:
  67. copy %sys%\ntfrsapi.dll %LOGDIR% 1>nul: 2>nul:
  68. echo ...................... >> %LOG%
  69. echo 58, %FRS_API_LOGS% >> %LOG%
  70. dir /od %FRS_API_LOGS% >> %LOG% 2>nul:
  71. echo 59, End %FRS_API_LOGS% >> %LOG%
  72. copy %FRS_API_LOGS% %LOGDIR% 1>nul: 2>nul:
  73. echo ...................... >> %LOG%
  74. echo 68, %DCPROMO_LOGS% >> %LOG%
  75. dir /od %DCPROMO_LOGS% >> %LOG% 2>nul:
  76. echo 69, End %DCPROMO_LOGS% >> %LOG%
  77. copy %DCPROMO_LOGS% %LOGDIR% 1>nul: 2>nul:
  78. echo ...................... >> %LOG%
  79. echo 78, DiskSpace >> %LOG%
  80. if EXIST %xxdu% (
  81. echo using %xxdu% >> %LOG%
  82. %xxdu% /s %windir% >> %LOG%
  83. )
  84. echo 79, End DiskSpace >> %LOG%
  85. echo ...................... >> %LOG%
  86. echo 88, RegistryData >> %LOG%
  87. if EXIST !xxregdmp! (
  88. echo using %xxregdmp% >> %LOG%
  89. !xxregdmp! HKEY_LOCAL_MACHINE\system\currentcontrolset\services\ntfrs >> %LOG%
  90. )
  91. echo 89, End RegistryData >> %LOG%
  92. echo Running Dstree (please be patient)
  93. echo ...................... >> %LOG%
  94. echo 90, DsTreeData >> %LOG%
  95. if EXIST !xxdstree! (
  96. echo using %xxdstree% >> %LOG%
  97. !xxdstree! >> %LOG%
  98. )
  99. echo 91, End DsTreeData >> %LOG%
  100. echo ...................... >> %LOG%
  101. echo 92, SysvolLinks >> %LOG%
  102. if EXIST !xxlinkd! (
  103. echo using %xxlinkd% >> %LOG%
  104. for /f %%x in ('dir /b \\.\sysvol\*.*') do (
  105. !xxlinkd! \\.\sysvol\%%x >> %LOG%
  106. )
  107. )
  108. echo 93, End SysvolLinks >> %LOG%
  109. echo ...................... >> %LOG%
  110. echo 98, VersionData >> %LOG%
  111. if EXIST !xxfrs! (
  112. echo using %xxfrs% >> %LOG%
  113. !xxfrs! version >> %LOG%
  114. )
  115. dir %sys%\ntfrs.exe %sys%\ntfrsapi.dll %sys%\dcpromo.exe %sys%\dcpromo.dll >> %LOG%
  116. if EXIST !xxfilever! (
  117. echo using %xxfilever% >> %LOG%
  118. for %%x in (drivers\ntfs.sys ) do !xxfilever! %sys%\%%x >> %LOG%
  119. for %%x in (ntfrs dcpromo ntoskrnl ntkrnlmp rpcss) do !xxfilever! %sys%\%%x.exe >> %LOG%
  120. for %%x in (ntfrs dcpromo rpclt1 rpcns4 rpcrt4 dsrole wldap32 netapi32) do !xxfilever! %sys%\%%x.dll >> %LOG%
  121. for %%x IN (ese esent rpcrt4 imagehlp user32 kernel32 ntdll netlib ntdsapi ws2_32) do !xxfilever! %sys%\%%x.dll >> %LOG%
  122. )
  123. echo 99, End VersionData >> %LOG%
  124. echo ...................... >> %LOG%
  125. echo 108, NTFRSWorkingDir >> %LOG%
  126. dir /s %windir%\ntfrs >> %LOG% 2>nul:
  127. echo ....... create times ...>> %LOG%
  128. dir /s /t:c %windir%\ntfrs >> %LOG% 2>nul:
  129. dir /s /AH %windir%\ntfrs >> %LOG% 2>nul:
  130. echo 109, End NTFRSWorkingDir >> %LOG%
  131. echo Running netdiag.
  132. echo ...................... >> %LOG%
  133. echo 118, NETDiag >> %LOG%
  134. if EXIST !xxnetdiag! (
  135. echo using %xxnetdiag% >> %LOG%
  136. !xxnetdiag! /debug >> %LOG%
  137. )
  138. echo 119, End NETDiag >> %LOG%
  139. echo Running nltest.
  140. echo ...................... >> %LOG%
  141. echo 128, NLTest >> %LOG%
  142. if EXIST !xxnltest! (
  143. echo using %xxnltest% >> %LOG%
  144. !xxnlttest! /dclist:%userdomain% >> %LOG%
  145. )
  146. echo 129, End NLTest >> %LOG%
  147. echo ...................... >> %LOG%
  148. echo 138, FrsSets >> %LOG%
  149. if EXIST !xxfrs! (
  150. echo using %xxfrs% >> %LOG%
  151. !xxfrs! sets >> %LOG%
  152. )
  153. echo 139, End FrsSets >> %LOG%
  154. echo ...................... >> %LOG%
  155. echo 148, FrsDs >> %LOG%
  156. if EXIST !xxfrs! (
  157. echo using %xxfrs% >> %LOG%
  158. !xxfrs! ds >> %LOG%
  159. )
  160. echo 149, End FrsDs >> %LOG%
  161. echo ...................... >> %LOG%
  162. echo 158, FrsComm >> %LOG%
  163. if EXIST !xxfrs! (
  164. echo using %xxfrs% >> %LOG%
  165. !xxfrs! comm >> %LOG%
  166. )
  167. echo 159, End FrsComm >> %LOG%
  168. echo Saving status file.
  169. copy %log% %dest% 1>nul: 2>nul:
  170. del %log%
  171. echo Logs and status written to %dest%
  172. :QUIT