@echo off
setlocal
title NetroDrive - Uninstaller
echo(
echo   ===  Uninstall NetroDrive  ===
echo(
set "APP=%LOCALAPPDATA%\Programs\NetroDriveDesktop"
echo   Closing the app...
taskkill /im NetroDriveDesktop.exe /f >nul 2>&1
if exist "%APP%\unins000.exe" (
  echo   Running the built-in uninstaller...
  "%APP%\unins000.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
) else (
  echo   Removing app files, Explorer sidebar entries and startup...
  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
  reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\NetroDriveDesktop" /f >nul 2>&1
  del "%APPDATA%\Microsoft\Windows\Start Menu\Programs\NetroDrive.lnk" >nul 2>&1
  del "%USERPROFILE%\Desktop\NetroDrive.lnk" >nul 2>&1
  if exist "%APP%" rmdir /s /q "%APP%"
  "%SystemRoot%\System32\ie4uinit.exe" -show
)
echo(
echo   NetroDrive has been removed.
echo   (Your files in the NetroDrive folders are kept - delete them manually if you want.)
echo(
pause
