OS: Windows Operating Systems
Question:
How to access and view PCI Devices using Visual Basic Script.
Instead of using Windows Device Manager you can use a simple script to run to view PCI devices.
Answer:
1. Open up your notepad application
2. Copy the following codes paste it on your Notepad
Set buses = GetObject("winmgmts:").InstancesOf("Win32_Bus")
For Each bus In buses
If(bus.BusType = 5) Then
strmsg = strmsg + bus.DeviceID & vbcrlf
Set devices = GetObject("winmgmts:").ExecQuery ("Associators of {Win32_Bus.DeviceID=""" & bus.DeviceID & """} WHERE AssocClass = Win32_DeviceBus")
For Each device In devices
strmsg = strmsg + " " & device.name & vbcrlf
Next
End If
Next
WScript.Echo strmsg
3. Save it as PCI.vbs. You can name it anything you like as long as the extension file is "vbs"
Tags:
© 2013 Created by XpansionX.
Powered by