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.

66 lines
2.4 KiB

  1. 'This script shows how you can list all machine hardware details
  2. on error resume next
  3. set theLocator = CreateObject("WbemScripting.SWbemLocator")
  4. if err <> 0 then
  5. WScript.Echo "Error on CreateObject" & Err.Number & Err.Description
  6. end if
  7. set Service = theLocator.ConnectServer("wmi-tecra1", "root\cimv2", "Administrator")
  8. Service.Security_.impersonationLevel = 3
  9. if err <> 0 then
  10. WScript.Echo "Error on ConnectServer" & Err.Number & Err.Description
  11. end if
  12. ' THE PROCESSORS
  13. Wscript.Echo
  14. Wscript.Echo "The Processors on the machine:"
  15. for each Processor in Service.InstancesOf ("Win32_Processor")
  16. WScript.Echo Processor.Name & " Revision: " & Processor.Revision
  17. WScript.Echo "DeviceID: " & Processor.DeviceID
  18. WScript.Echo "Description: " & Processor.Description
  19. WScript.Echo "AddressWidth: " & Processor.AddressWidth
  20. WScript.Echo "DataWidth: " & Processor.DataWidth
  21. WScript.Echo "CurrentClockSpeed: " & Processor.CurrentClockSpeed
  22. Wscript.Echo
  23. next
  24. if err <> 0 then
  25. WScript.Echo "Error" & Err.Number & Err.Description
  26. end if
  27. ' THE Disk Drives
  28. Wscript.Echo
  29. Wscript.Echo "The Disk Drives on the machine:"
  30. for each Drive in Service.InstancesOf ("Win32_DiskDrive")
  31. WScript.Echo "DeviceID: " & Drive.DeviceID
  32. WScript.Echo "Description: " & Drive.Description
  33. WScript.Echo "Caption: " & Drive.Caption
  34. WScript.Echo "Size: " & Drive.Size
  35. WScript.Echo "BytesPerSector: " & Drive.BytesPerSector
  36. WScript.Echo "SectorsPerTrack: " & Drive.SectorsPerTrack
  37. WScript.Echo "InterfaceType: " & Drive.InterfaceType
  38. WScript.Echo "MediaType: " & Drive.MediaType
  39. WScript.Echo "Manufacturer: " & Drive.Manufacturer
  40. WScript.Echo "Number of partitions: " & Drive.Partitions
  41. WScript.Echo "TotalCylinders: " & Drive.TotalCylinders
  42. WScript.Echo "TotalHeads: " & Drive.TotalHeads
  43. WScript.Echo "TotalHeads: " & Drive.TotalHeads
  44. WScript.Echo "TracksPerCylinder: " & Drive.TracksPerCylinder
  45. Wscript.Echo
  46. next
  47. ' THE CD ROM Drives
  48. Wscript.Echo
  49. Wscript.Echo "The CD ROM Drives on the machine:"
  50. for each Drive in Service.InstancesOf ("Win32_CDRomDrive")
  51. WScript.Echo "DeviceID: " & Drive.DeviceID
  52. WScript.Echo "Description: " & Drive.Description
  53. WScript.Echo "Caption: " & Drive.Caption
  54. WScript.Echo "MediaType: " & Drive.MediaType
  55. WScript.Echo "Manufacturer: " & Drive.Manufacturer
  56. WScript.Echo "MediaLoaded: " & Drive.MediaLoaded
  57. if Drive.MediaLoaded then
  58. WScript.Echo "VolumeName: " & Drive.VolumeName
  59. end if
  60. Wscript.Echo
  61. next