Inside Man
Inside Man

Reputation: 4319

Get List Of Connected Joysticks using VBScript

I'm looking for a way that I can get list of connected joysticks via VBScript just like in the picture below (I mean the order of them is highly important):

joy.cpl is list the connected joysticks

Upvotes: 0

Views: 512

Answers (1)

Jigar Pandya
Jigar Pandya

Reputation: 5987

Here is the code to do that... hard to find on net...

strComputer = "." Set objWMIService = GetObject("winmgmts:" _ &
"{impersonationLevel=impersonate}!\\" & strComputer & "oot\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from
Win32_PnPEntity")

For Each objItem in colItems

Wscript.Echo "Class GUID: " & objItem.ClassGuid
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Device ID: " & objItem.DeviceID
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "PNP Device ID: " & objItem.PNPDeviceID
Wscript.Echo "Service: " & objItem.Service

Next

Hope this helps

Upvotes: 1

Related Questions