@echo off
setlocal
net session >nul 2>&1
if not %errorlevel%==0 (
  echo Please right-click Uninstall-Agent.bat and choose Run as administrator.
  pause
  exit /b 1
)
taskkill /IM ConnectDesk-Agent.exe /F >nul 2>&1
del /Q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup\ConnectDesk Agent.lnk" >nul 2>&1
del /Q "%Public%\Desktop\ConnectDesk Agent.lnk" >nul 2>&1
rmdir /S /Q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\ConnectDesk" >nul 2>&1
rmdir /S /Q "%ProgramData%\ConnectDesk" >nul 2>&1
echo ConnectDesk Agent removed.
pause
