5_uninstall_service.bat 1.3 KB
Newer Older
1 2
@echo off
setlocal
3
pushd "%~dp0"
4 5 6 7 8 9 10 11

rem Copyright (c) 1999, 2006 Tanuki Software Inc.
rem
rem Java Service Wrapper general NT service uninstall script
rem

if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
12
goto :end
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

:nt
rem
rem Find the application home.
rem
rem %~dp0 is location of current script under NT
set _REALPATH=%~dp0

rem Decide on the wrapper binary.
set _WRAPPER_BASE=wrapper
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
if exist "%_WRAPPER_EXE%" goto conf
set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
if exist "%_WRAPPER_EXE%" goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
echo %_REALPATH%%_WRAPPER_BASE%.exe
pause
34
goto :end
35

36
:conf
37 38 39 40 41 42 43
rem
rem Find the wrapper.conf
rem
set _WRAPPER_CONF="%~f1"
if not %_WRAPPER_CONF%=="" goto startup
set _WRAPPER_CONF="%_REALPATH%wrapper.conf"

44
:startup
45 46 47 48
rem
rem Uninstall the Wrapper as an NT service.
rem
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
49
if not errorlevel 1 goto :end
50 51
pause

52 53
:end
popd