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.

98 lines
1.4 KiB

  1. '
  2. ' Test IConfigureYourServer::IsDhcpConfigured
  3. '
  4. option explicit
  5. const SCRIPT_FILENAME = "test-IsDhcpConfigured.vbs"
  6. const SCRIPT_SOURCE_NAME = "z:\\nt\\admin\\cys\\test\\test-isdhcpconfigured.vbt"
  7. const SCRIPT_DATE = "May 22 2000"
  8. const SCRIPT_TIME = "17:58:02"
  9. ' common.vbi
  10. ' common routines and definitions
  11. '
  12. const NEG_ONE = &HFFFFFFFF
  13. Sub Echo(byref message)
  14. wscript.echo message
  15. End sub
  16. ' Echos the contents of the Err object.
  17. sub DumpErr
  18. dim errnum
  19. errnum = Err.Number
  20. Echo "Error 0x" & CStr(Hex(errnum)) & " occurred."
  21. if len(Err.Description) then
  22. Echo "Description: " & Err.Description
  23. end if
  24. if len(Err.Source) then
  25. Echo "Source : " & Err.Source
  26. end if
  27. if len(Err.HelpContext) then
  28. Echo "Context : " & Err.HelpContext
  29. end if
  30. if len(Err.HelpFile) then
  31. Echo "Help File : " & Err.HelpFile
  32. end if
  33. end sub
  34. sub DumpErrAndQuit
  35. dim errnum
  36. errnum = Err.Number
  37. DumpErr
  38. wscript.quit(errnum)
  39. end sub
  40. '
  41. ' end common.vbi
  42. '
  43. Main
  44. wscript.quit(0)
  45. sub Main
  46. On Error Resume Next
  47. Dim srvwiz
  48. Set srvwiz = CreateObject("ServerAdmin.ConfigureYourServer")
  49. dim i
  50. i = srvwiz.IsDhcpConfigured
  51. if Err.Number then DumpErrAndQuit
  52. echo i
  53. if i Then
  54. Echo "dhcp configured"
  55. else
  56. Echo "dhcp NOT configured"
  57. end if
  58. End sub