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.

51 lines
887 B

  1. ' starts the Configure DNS Server Wizard using MMC automation interfaces
  2. option explicit
  3. Dim mmc
  4. Set mmc = CreateObject("MMC20.Application")
  5. ' uncomment this to cause the MMC console to appear
  6. 'Dim frame
  7. 'Set frame = mmc.Frame
  8. 'frame.restore
  9. Dim doc
  10. Set doc = mmc.Document
  11. Dim namespace
  12. Set namespace = doc.ScopeNamespace
  13. Dim snapins
  14. Set snapins = doc.snapins
  15. Dim snapin
  16. const DNS_SNAPIN_CLSID = "{2FAEBFA2-3F1A-11D0-8C65-00C04FD8FECB}"
  17. ' if DNS is not installed, this will fail.
  18. set snapin = snapins.Add(DNS_SNAPIN_CLSID)
  19. Dim views
  20. Set views = doc.views
  21. Dim view
  22. Set view = views(1)
  23. Dim rootnode
  24. Set rootnode = namespace.GetRoot
  25. View.ActiveScopeNode = namespace.GetChild(rootnode)
  26. View.ActiveScopeNode = namespace.GetChild(View.ActiveScopeNode)
  27. Dim menu
  28. Set menu = view.ScopeNodeContextMenu
  29. Dim menuItem
  30. Set menuItem = menu.item(2)
  31. menuItem.Execute
  32. doc.Close(FALSE)