Created
August 31, 2020 10:19
-
-
Save dzzie/692eebdd429ee63cacdcb82021a6668e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'save this file as enumSerialPorts.vbs | |
'open a command shell, | |
'change directory to the same folder the vbs script is in (cd command) | |
'type in: cscript enumSerialPorts.vbs | |
'if WMI is working it should print out any connected COM port devices like arduinos. | |
strComputer = "." | |
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") | |
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_SerialPort", , 48) | |
For Each objItem In colItems | |
WScript.echo objItem.DeviceID & " " & objItem.Description | |
Next |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment