@echo off && setlocal enabledelayedexpansion
echo --RUSH Auto Works--
echo --Automated GCU Flasher--
for /f "tokens=2delims=COM:" %%i in ('mode ^| findstr /RC:"\C\O\M[0-9*]"') do set "_com=%%i" & avrdude\avrdude.exe -Cavrdude\avrdude.conf -v -patmega2560 -cwiring -P COM!_com! -b115200 -D -Uflash:w:targets/release_CAN-3.0.6.hex:i
echo:
pause
