@echo off
setlocal
fltmc >nul 2>&1
if errorlevel 1 (
  powershell.exe -NoProfile -WindowStyle Hidden -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
  exit /b
)
cd /d "%~dp0"
set "AMAGING_HOST_DEST=%ProgramFiles%\Amaging Remote Portable Host"
net.exe stop AmagingHostService >nul 2>&1
"%AMAGING_HOST_DEST%\amaging-host.exe" uninstall
sc.exe delete AmagingHostService >nul 2>&1
netsh.exe advfirewall firewall delete rule name="Amaging Remote Host" >nul 2>&1
rmdir /s /q "%AMAGING_HOST_DEST%" >nul 2>&1
echo.
echo Amaging Remote host service was removed.
pause
