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%.
_________________________
Tony Fabris