@echo off
pushd %~dp0
echo stopping ComProxy service
ComProxySrv.exe stop ComProxy >nul 2>&1
@echo off > gui_stop.tsk
ping -n 13 localhost  >nul 2>&1
ComProxySrv.exe delete ComProxy  >nul 2>&1
ping -n 5 localhost  >nul 2>&1
c0c\uninstall /S
pause
rd /Q /S jre
rd /Q /S libs
rd /Q /S libx32
rd /Q /S libx64
rd /Q /S logs
rd /Q /S libxarmhf
rd /Q /S ppp
rd /Q /S tasks
rd /Q /S oldVersion
ping -n 5 localhost  >nul 2>&1
del /F /S /Q /A "%~dp0\ComProxy.ini"
del /F /S /Q /A "%~dp0\ComProxyUpdater.jar"
del /F /S /Q /A "%~dp0\ComProxy.jar"
del /F /S /Q /A "%~dp0\ComProxySrv.exe"
del /F /S /Q /A "%~dp0\KSL.exe"
del /F /S /Q /A "%~dp0\firmware_new.bin"
del /F /S /Q /A "%~dp0\ComProxy_new.jar"
del /F /S /Q /A "%~dp0\gui_stop.tsk"
start/b cmd /c del "%~f0"
popd