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.

66 lines
1.4 KiB

  1. '
  2. ' Test IConfigureYourServer::IsServiceInstalled
  3. '
  4. option explicit
  5. // this is a Visual Basic Script "Template", used in conjunction with the
  6. // MS Visual C++ Preprocessor to overcome some of the source management
  7. // limitations of VBScript. Not perfect, but better than a stick in the eye.
  8. //
  9. // use cl /EP foo.vbt > foo.vbs to expand the template
  10. const SCRIPT_FILENAME = "test-IsServiceInstalled.vbs"
  11. const SCRIPT_SOURCE_NAME = __FILE__
  12. const SCRIPT_DATE = __DATE__
  13. const SCRIPT_TIME = __TIME__
  14. // this is all our common code.
  15. #include "common.vbi"
  16. Main
  17. wscript.quit(0)
  18. sub Main
  19. On Error Resume Next
  20. Dim srvwiz
  21. Set srvwiz = CreateObject("ServerAdmin.ConfigureYourServer")
  22. Dim services(6)
  23. services(0) = "DNS"
  24. services(1) = "DHCP"
  25. services(2) = "RRAS"
  26. services(3) = "WINS"
  27. services(4) = "IIS"
  28. services(5) = "StreamingMedia"
  29. services(6) = "MessageQueue"
  30. Dim i
  31. Dim j
  32. For i = 0 to Ubound(services)
  33. Err.Clear
  34. j = srvWiz.IsServiceInstalled(services(i))
  35. If Err.Number then DumpErrAndQuit
  36. Echo j
  37. Select case j
  38. case 0
  39. Echo services(i) & " is not installed"
  40. case 1
  41. Echo services(i) & " is installed"
  42. case NEG_ONE
  43. Echo services(i) & " cannot be installed on this OS"
  44. case else
  45. Echo services(i) & " incomprehensible response"
  46. End select
  47. Next
  48. End sub