#352203 - 16/05/201220:16Re: Windows command to quickly list the available COM ports on a system?
[Re: tfabris]
tfabris carpal tunnel
Registered: 20/12/1999
Posts: 31618
Loc: Seattle, WA
And the full DOS command to put the query into a variable that I can use elsewhere in the batch file is:
Code:
for /f "usebackq" %%B in (`wmic path Win32_SerialPort Where "Caption LIKE '%%Arduino%%'" Get DeviceID ^| FIND "COM"`) do set comport=%%B
echo Com Port for Arudino device is detected as %comport%.