@title e3372h modem restoration

@prompt $G 

@echo.
@echo Enable erase of (pseudo) bed blocks ?
@echo 1 - no
@echo 2 - yes 
@echo 0 - exit
@set choice=
@set /P choice=": "

@if "%choice%" == "0" goto quit
@^
if not "%choice%" == "1" (
if not "%choice%" == "2" (
  echo.
  echo Invalid input
  goto quit
))

@if "%choice%" == "1" set fastboot=-f
@if "%choice%" == "2" set fastboot=-b

balong_usbdload %fastboot% -t ptable-hilink.bin -s4 -s14 -s16 usblsafe-3372h.bin

@echo.
@echo Wait for the device override and press Enter
@pause > nul

fastboot -i0x12d1 getvar product

@echo.
@echo If you see the line "product: balong v7r2", then press Enter
@pause > nul

fastboot -i0x12d1 erase m3boot
fastboot -i0x12d1 erase fastboot
@rem fastboot -i0x12d1 erase nvbacklte
fastboot -i0x12d1 erase nvimg
fastboot -i0x12d1 erase nvdload
fastboot -i0x12d1 erase oeminfo
fastboot -i0x12d1 erase kernel
fastboot -i0x12d1 erase kernelbk
fastboot -i0x12d1 erase m3image
fastboot -i0x12d1 erase dsp
fastboot -i0x12d1 erase vxworks
fastboot -i0x12d1 erase wbdata
fastboot -i0x12d1 erase om
fastboot -i0x12d1 erase app
fastboot -i0x12d1 erase webui
fastboot -i0x12d1 erase system
fastboot -i0x12d1 erase userdata
fastboot -i0x12d1 erase online
fastboot -i0x12d1 erase cdromiso

fastboot -i0x12d1 reboot

:quit

@echo.
@echo Script is done. Press Enter
@pause > nul
