Batch – Show all available COM ports

This batch file will dive into your registry and display any active COM ports.

 

 

@echo off
SETLOCAL EnableDelayedExpansion

echo.
echo.
echo       If you don't see your COM Port below... Something is wrong^^!^^!^^!
echo.
echo.

reg query HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM | find "REG_SZ" > %temp%\comlist-temp.txt

echo.

echo.                             Active COM Ports:
echo.
echo.

for /f "tokens=2,4* delims=\= " %%a in (%temp%\comlist-temp.txt) do echo.                            %%b   (%%a)

echo.
echo.
timeout 5

Also (my favorite):

wmic path win32_pnpentity get caption /format:table | find "COM"

Also:

for /f "tokens=4" %%A in ('mode^|findstr "COM[0-9]*:"') do echo %%A

Leave a Reply

Your email address will not be published. Required fields are marked *