Source code of Windows XP (NT5)
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.

68 lines
2.3 KiB

  1. @echo on
  2. @rem
  3. setlocal
  4. if "%1"=="" goto :Usage
  5. set MACHINE=%1
  6. set STATUSFILE=\\%MACHINE%\BC_DISTSTATUS\%COMPUTERNAME%.txt
  7. echo Started RegisterMTScript.cmd > %STATUSFILE%
  8. for /f %%x in ('hostname') do set myname=%%x
  9. net share BC_BUILD_LOGS /delete /y
  10. rmtshare \\%MACHINE%\BC_DISTSTATUS=%temp% /grant ntdev\ntbuild:full
  11. @rem net share BC_BUILD_LOGS=%TEMP% /Remark:"Build Console build logs share"
  12. if errorlevel 1 (call :RegError Error creating BC_BUILD_LOGS share & goto :PauseBeforeExit)
  13. if exist MTRCopy.dll (
  14. regsvr32 /s MTRCopy.dll || (call :RegError Error registering MTRCopy.dll & goto :PauseBeforeExit)
  15. ) else (
  16. regsvr32 /s RCopy.dll || (call :RegError Error registering RCopy.dll & goto :PauseBeforeExit)
  17. )
  18. regsvr32 /s mtscrprx.dll || (call :RegError Error registering mtscrprx.dll & goto :PauseBeforeExit)
  19. regsvr32 /s mtlocal.dll || (call :RegError Error registering mtlocal.dll & goto :PauseBeforeExit)
  20. regsvr32 /s mtodproxy.dll || (call :RegError Error registering mtodproxy.dll & goto :PauseBeforeExit)
  21. @Rem Unregister first to reset security information
  22. mtscript.exe /unregister
  23. mtscript.exe /register
  24. if ERRORLEVEL 1 (call :RegError Error registering mtscript.exe & goto :PauseBeforeExit)
  25. @Rem Unregister first to reset security information
  26. mtodaemon.exe /unregister
  27. mtodaemon.exe /register
  28. if ERRORLEVEL 1 (call :RegError Error registering mtodaemon.exe & goto :PauseBeforeExit)
  29. @rem This process was started CreateProcessWithLogonW (from bsrunas.exe). This
  30. @rem means that we are in a job object. This interferes with mtscript's job
  31. @rem management. Thus, we will rely on automatic launching to get mtscript going.
  32. @rem start mtscript.exe
  33. @rem if ERRORLEVEL 1 (call :RegError mtscript.exe & goto :PauseBeforeExit)
  34. echo OK> %STATUSFILE%
  35. goto :PauseBeforeExit
  36. :RegError
  37. @echo ==============================================
  38. @echo FAILED RegisterMTScript.cmd: %* > %STATUSFILE%
  39. net send %MACHINE% %* on host %myname%
  40. goto :PauseBeforeExit
  41. :Usage
  42. @echo.
  43. @echo.
  44. @echo ===================================================
  45. @echo Usage: registermtscript.cmd NotifyMachine directory
  46. @goto :PauseBeforeExit
  47. :PauseBeforeExit
  48. @echo.
  49. @echo.
  50. @echo This window will close 30 minutes after %DATE% %TIME%
  51. @echo Presss Ctrl-BREAK to prevent this
  52. Sleep 1800
  53. if ERRORLEVEL 1 goto :EOF
  54. exit 1
  55. goto :EOF