@echo off
rem RemoveService.bat
rem
rem Stops and removes the given Service
rem
rem Smedge 3
rem Copyright Uberware. All Rights Reserved



rem NOTE: This script is meant to be run by a system administrator. 
rem NOTE: It does not check that the current running use has administrative privileges.
rem NOTE: Use by a non-administrator will lead to failure and inconsistent behavior


rem check for a service to stop and remove
if [%1] == [] goto :usage

rem stop it
echo ... Stopping %1
net stop %1  1>nul 2>nul

rem remove it
echo ... Removing %1
sc delete %1  1>nul 2>nul

rem done!
exit /b 0

:usage

echo RemoveService.bat ^<name^>
echo.
echo ^<name^> must correspond to an installed Service
echo.
pause
exit /b 1
