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.

69 lines
2.4 KiB

  1. @echo off
  2. echo Removing Windows NT SMTPSVC Server Performance Counters ....
  3. if "%1" == "quiet" goto Continue
  4. echo Press any key to continue or CTRL-C to exit.
  5. pause >nul
  6. :Continue
  7. :Evars -------------------------------------------------------------------------
  8. :. Only NT would have this evar set.
  9. if "%PROCESSOR_ARCHITECTURE%" == "" goto ErrProcessor
  10. :Conditions --------------------------------------------------------------------
  11. :. Check if NT is installed properly.
  12. if not exist %SystemRoot%\System32\ntoskrnl.exe goto ErrWinDir
  13. if not exist %SystemRoot%\System32\unlodctr.exe goto ErrWinDir
  14. :ChkFiles ----------------------------------------------------------------------
  15. :. Check if the user is in the setup directory.
  16. if not exist smtprctr.bat goto ErrChkFiles
  17. :. Check if all the tools are there.
  18. if not exist %SystemRoot%\System32\unlodctr.exe goto ErrChkFiles
  19. :Start Removal -----------------------------------------------------------------
  20. :. Delete the DLL.
  21. del %SystemRoot%\System32\smtpctrs.dll >nul
  22. if errorlevel 1 echo WARNING: %SystemRoot%\System32\smtpctrs.dll is not found.
  23. :. Remove the service from the Registry.
  24. unlodctr SmtpSvc
  25. if errorlevel 1 goto Failure
  26. :Success
  27. echo.
  28. echo Successfully removed Windows NT SMTPSVC Server Performance Counters.
  29. goto CleanUp
  30. :Failure
  31. echo.
  32. echo WARNING: Unable to remove the Windows NT SMTPSVC Server Performance Counters.
  33. goto CleanUp
  34. :. Errors ----------------------------------------------------------------------
  35. :ErrChkFiles
  36. echo ERROR: One or more files required by this installation is not found
  37. echo in the current directory.
  38. echo.
  39. echo Be sure that %0 is started from the installation directory.
  40. echo If installing the debug version, go to WINDEBUG;
  41. echo if installing the release version, go to WINREL.
  42. echo If this error still occurs, you may be missing files.
  43. goto CleanUp
  44. :ErrProcessor
  45. echo ERROR: The PROCESSOR_ARCHITECTURE environment variable is not set.
  46. echo Windows NT may not be installed properly.
  47. goto CleanUp
  48. :ErrWinDir
  49. echo ERROR: Unable to find required files in %SystemRoot%\System32.
  50. echo Windows NT may not be installed properly.
  51. goto CleanUp
  52. :CleanUp -----------------------------------------------------------------------
  53. :End ---------------------------------------------------------------------------