@echo off
@setlocal enableextensions
@cd /d "%~dp0"
set SERVICE_NAME=ABS_UHFConcentrator

goto check_Permissions

:check_Permissions
    net session >nul 2>&1
    if %errorLevel% == 0 (
			echo Stopping %SERVICE_NAME% Service...
			nssm.exe stop %SERVICE_NAME%
			echo Uninstalling %SERVICE_NAME% Service...
			nssm.exe remove %SERVICE_NAME% confirm
			echo SUCCESS!
    ) else (
			echo ERROR: You need administrator privileges in order to uninstall %SERVICE_NAME% service!
    )
pause