Leaked source code of windows server 2003
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.

40 lines
1.1 KiB

  1. '
  2. L_Welcome_MsgBox_Message_Text = "This script demonstrates how to access MMC using the Windows Scripting Host. It creates and configures a console and saves it to c:\mmctest.msc"
  3. L_Welcome_MsgBox_Title_Text = "Windows Scripting Host Sample"
  4. Call Welcome()
  5. ' ********************************************************************************
  6. Dim mmc
  7. Dim doc
  8. Dim snapins
  9. Dim frame
  10. set mmc = wscript.CreateObject("MMC20.Application")
  11. Set frame = mmc.Frame
  12. Set doc = mmc.Document
  13. Set snapins = doc.snapins
  14. snapins.Add "{58221c66-ea27-11cf-adcf-00aa00a80033}" ' the services snap-in
  15. frame.Restore ' show the UI
  16. doc.SaveAs "C:\mmctest.msc"
  17. set mmc = Nothing
  18. ' ********************************************************************************
  19. ' *
  20. ' * Welcome
  21. ' *
  22. Sub Welcome()
  23. Dim intDoIt
  24. intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _
  25. vbOKCancel + vbInformation, _
  26. L_Welcome_MsgBox_Title_Text )
  27. If intDoIt = vbCancel Then
  28. WScript.Quit
  29. End If
  30. End Sub