@echo off
setlocal enabledelayedexpansion
cls
color f0
echo -----------------------------
echo - Update tool ESP32 TEF6686 -
echo -     Development beta      -
echo -----------------------------
echo.
echo Available COM-ports:
set _key="HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM"
for /f "tokens=3 delims= " %%c in ('reg query !_key! ^| find /v
"HKEY"') do set "_com_N=%%c"&& echo/!_com_N:~3! = !_com_N!
echo.
set /p "COM=Enter Comport number (example: 3): "
esptool.exe --chip esp32 --port COM%COM% --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 TEF6686_ESP32.ino.bootloader.bin 0x8000 TEF6686_ESP32.ino.partitions.bin 0xe000 boot_app0.bin 0x10000 TEF6686_ESP32.ino.bin
echo.
echo When no errors, press any key to close this program.
@pause >NULL
endlocal