@echo off
setlocal enabledelayedexpansion
title NetroApply - Remove all desktop apps
echo(
echo   ==============================================
echo     Remove ALL NetroApply desktop apps
echo   ==============================================
echo(
echo   This will uninstall NetroTalk Desktop, NetroDrive,
echo   and NetroApply Desktop from this PC.
echo(
choice /c YN /m "   Continue"
if errorlevel 2 goto :cancel

echo(
echo   [1/3] NetroTalk Desktop...
taskkill /im NetroTalkDesktop.exe /f >nul 2>&1
taskkill /im NTalkDesktop.exe /f >nul 2>&1
set "T=%LOCALAPPDATA%\Programs\NetroTalkDesktop"
if exist "!T!\unins000.exe" ( "!T!\unins000.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART ) else (
  reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "NetroTalk" /f >nul 2>&1
  if exist "!T!" rmdir /s /q "!T!"
)

echo   [2/3] NetroDrive...
taskkill /im NetroDriveDesktop.exe /f >nul 2>&1
set "D=%LOCALAPPDATA%\Programs\NetroDriveDesktop"
if exist "!D!\unins000.exe" ( "!D!\unins000.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART ) else (
  reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "NetroDrive" /f >nul 2>&1
  reg delete "HKCU\Software\Classes\CLSID\{B0A7D3E2-5C41-4F68-9A2B-7D5E1C3F8B40}" /f >nul 2>&1
  reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{B0A7D3E2-5C41-4F68-9A2B-7D5E1C3F8B40}" /f >nul 2>&1
  reg delete "HKCU\Software\Classes\CLSID\{C1B8E4F3-6D52-4A79-8B3C-9E6F2D4A7C51}" /f >nul 2>&1
  reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{C1B8E4F3-6D52-4A79-8B3C-9E6F2D4A7C51}" /f >nul 2>&1
  if exist "!D!" rmdir /s /q "!D!"
  "%SystemRoot%\System32\ie4uinit.exe" -show
)

echo   [3/3] NetroApply Desktop...
taskkill /im NetroApplyDesktop.exe /f >nul 2>&1
set "A=%LOCALAPPDATA%\Programs\NetroApplyDesktop"
if exist "!A!\unins000.exe" ( "!A!\unins000.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART ) else (
  reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "NetroApply" /f >nul 2>&1
  for %%D in ("%LOCALAPPDATA%\Programs\NetroApplyDesktop" "%LOCALAPPDATA%\Programs\NetroApplyDesktop-win32-x64" "%USERPROFILE%\NetroApplyDesktop") do if exist "%%~D" rmdir /s /q "%%~D"
)

echo(
echo   All NetroApply desktop apps have been removed.
echo(
pause
goto :eof

:cancel
echo   Cancelled - nothing was removed.
pause
