see open serial ports on pc with cmd code example

Example: monitoring serial ports with cmd

SerialMonitor.EXE /new   
   PORT
   [A] [T] [L] [R] [D]
      
      /*
      “PORT” defines the serial port to monitor (COM1, COM4, etc.)
      “A” means that monitoring should be started automatically once you press the “Enter” button
      “T” means that “Table View” should be toggled on
      “L” means that “Line View” should be toggled on
      “R” means that “Terminal View” should be toggled on
      “D” means that “Data View” should be toggled on
      */

SerialMonitor.exe /new COM1 ATLRD