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.

37 lines
781 B

  1. '
  2. ' test5.vbs
  3. '
  4. ' device creation / manipulation
  5. '
  6. Dim WshSHell
  7. Dim DevCon
  8. Dim Devs
  9. Dim Dev
  10. Dim HwIds
  11. Dim HwId
  12. Dim Strings
  13. set WshShell = WScript.CreateObject("WScript.Shell")
  14. set DevCon = WScript.CreateObject("DevCon.DeviceConsole")
  15. set Strings = WScript.CreateObject("DevCon.Strings")
  16. Strings.Add "a"
  17. Strings.Add "b"
  18. Strings.Add "c"
  19. set Devs = DevCon.CreateEmptyDeviceList()
  20. set Dev = Devs.CreateRootDevice("jimbo")
  21. Dev.FriendlyName = "MyName"
  22. Wscript.Echo "FriendlyName: "+Dev.FriendlyName
  23. Dev.HardwareIds = "doh"
  24. set HwIds = Dev.HardwareIds
  25. FOR EACH HwId IN HwIds
  26. WScript.Echo "HWID: " + HwId
  27. NEXT
  28. Dev.CompatibleIds = Strings
  29. set HwIds = Dev.CompatibleIds
  30. FOR EACH HwId IN HwIds
  31. WScript.Echo "Compat: " + HwId
  32. NEXT
  33. Dev.Delete