@echo off

cd %~dp0
echo FW image is ftkdisk_mu_hmb_combo.fw

devcon.exe enable *DEV_5216*
timeout /t 3

sedutil-cli.exe --scan > disklist.txt
timeout /t 3
type disklist.txt

findstr 5216 ./disklist.txt > targetdisk.txt
for /f %%i in (./targetdisk.txt) do (
set disk=%%i
)
echo %disk%
if %disk%== goto NODISK

:DOWNFW 
sedutil-cli.exe --download %disk% ../../bin/ftkdisk_mu_hmb_combo.fw
timeout /t 3

sedutil-cli.exe --commit %disk% 1 1
timeout /t 3

:end
echo download finished!
exit 0

:NODISK
echo ========================================
echo ERROR:Didn't find innogrit drive, please check.
timeout /t 10
exit 1






