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.

52 lines
885 B

  1. ' starts the DHCP New Scope 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 DHCP_SNAPIN_CLSID = "{90901AF6-7A31-11D0-97E0-00C04FC3357A}"
  17. ' if DHCP is not installed, this will fail.
  18. set snapin = snapins.Add(DHCP_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(3)
  31. menuItem.Execute
  32. doc.Close(FALSE)