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.

74 lines
1.3 KiB

  1. ' starts the RRAS snapin's Routing and Remote Access Server Setup Wizard
  2. option explicit
  3. Dim mmc
  4. Set mmc = CreateObject("MMC20.Application")
  5. ' msgbox(1)
  6. ' uncomment this to cause the MMC console to appear
  7. ' Dim frame
  8. ' Set frame = mmc.Frame
  9. ' frame.restore
  10. ' since the RRAS snapin does not automatically add the local computer
  11. ' to the scope pane, which is lame, we have to load their saved console
  12. ' file to do so.
  13. mmc.load("rrasmgmt.msc")
  14. ' Dim snapins
  15. ' Set snapins = doc.snapins
  16. 'Dim snapin
  17. 'const RAS_SNAPIN_CLSID = "{1AA7F839-C7F5-11D0-A376-00C04FC9DA04}"
  18. ' if RAS is not installed, this will fail.
  19. 'set snapin = snapins.Add(RAS_SNAPIN_CLSID)
  20. ' msgbox("snapin added")
  21. Dim doc
  22. Set doc = mmc.Document
  23. Dim views
  24. Set views = doc.views
  25. Dim view
  26. Set view = views(1)
  27. Dim namespace
  28. Set namespace = doc.ScopeNamespace
  29. Dim rootnode
  30. Set rootnode = namespace.GetRoot
  31. View.ActiveScopeNode = namespace.GetChild(rootnode)
  32. View.ActiveScopeNode = namespace.GetChild(View.ActiveScopeNode)
  33. View.ActiveScopeNode = namespace.GetNext(View.ActiveScopeNode)
  34. ' how do I get the snapin to add the local server to the scope node?
  35. ' msgbox("about to exec menu")
  36. Dim menu
  37. Set menu = view.ScopeNodeContextMenu
  38. Dim menuItem
  39. Set menuItem = menu.item(2)
  40. menuItem.Execute
  41. doc.Close(FALSE)