Skip to content

Instantly share code, notes, and snippets.

@artizirk
Last active December 5, 2023 09:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artizirk/d9b0cfa3a8430347d989ca6684196756 to your computer and use it in GitHub Desktop.
Save artizirk/d9b0cfa3a8430347d989ca6684196756 to your computer and use it in GitHub Desktop.
List SerialPort names in Windows

List COM ports in windows with names

HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
    \Device\Serial0    REG_SZ    COM1
    \Device\Silabser0    REG_SZ    COM6
    \Device\VCP0    REG_SZ    COM3

Press any key to continue . . .

Using wmic

WMIC.exe path  win32_pnpentity  where "PNPClass='Ports'" get  Caption,Service,Manufacturer
Caption                                        Manufacturer           Service
Silicon Labs CP210x USB to UART Bridge (COM6)  Silicon Labs           silabser
Communications Port (COM1)                     (Standard port types)  Serial
USB Serial Port (COM3)                         FTDI                   FTSER2K
WMIC.exe path  win32_pnpentity  where "PNPClass='Ports' AND Caption LIKE '%(COM6)'" get  Name,Service
Name                                           Service
Silicon Labs CP210x USB to UART Bridge (COM6)  silabser
WMIC.exe path  win32_pnpentity  where "PNPClass='Ports'" get  Caption,Service,Manufacturer '/format:list'
@ECHO OFF
reg query HKLM\HARDWARE\DEVICEMAP\SERIALCOMM
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment