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.

50 lines
1.1 KiB

  1. @echo off
  2. setlocal
  3. if "%1" == "" goto Help
  4. if "%1" == "-?" goto Help
  5. if "%1" == "/?" goto Help
  6. if /I "%1" == "/h" goto Help
  7. if /I NOT "-svchost" == "%1" goto CheckServices
  8. :CheckSvcHost
  9. echo hkey_local_machine\software\microsoft\windows nt\currentversion\svchost> %temp%\trkhost.ini
  10. echo trksvcs = REG_MULTI_SZ "trkwks" "trksvr" >> %temp%\trkhost.ini>> %temp%\trkhost.ini
  11. regini %temp%\trkhost.ini
  12. rem del %temp%\trkhost.ini
  13. goto Exit
  14. :CheckServices
  15. if /I NOT "-services" == "%1" goto BadParm
  16. echo *** Configuring TrkWks ***
  17. sc config trkwks type= share type= interact binpath= "%%windir%%\system32\services.exe"
  18. echo *** Configuring TrkSvr ***
  19. sc config trksvr type= share type= interact binpath= "%%windir%%\system32\services.exe"
  20. goto Exit
  21. :BadParm
  22. echo Error: must be either "-svchost" or "-services"
  23. goto Help
  24. :Help
  25. echo.
  26. echo Purpose: Set trksvr/trkwks to run in either svchost or services
  27. echo Usage: TrkHost [-services^|-svchost]
  28. echo Assumes: regini.exe ^& sc.exe are in your path
  29. echo E.g. TrkHost -svchost
  30. echo.
  31. :Exit