@echo off
REM #############################################################################
REM #
REM # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
REM #
REM # Copyright 2000-2007 Sun Microsystems, Inc. All rights reserved. 
REM #
REM # The contents of this file are subject to the terms of either the GNU
REM # General Public License Version 2 only ("GPL") or the Common Development
REM # and Distribution License ("CDDL") (collectively, the "License").  You may
REM # not use this file except in compliance with the License.  You can obtain
REM # a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
REM # or mq/legal/LICENSE.txt.  See the License for the specific language
REM # governing permissions and limitations under the License.
REM # 
REM # When distributing the software, include this License Header Notice in each
REM # file and include the License file at mq/legal/LICENSE.txt.  Sun designates
REM # this particular file as subject to the "Classpath" exception as provided by
REM # Sun in the GPL Version 2 section of the License file that accompanied this
REM # code.  If applicable, add the following below the License Header, with the
REM # fields enclosed by brackets [] replaced by your own identifying information:
REM # "Portions Copyrighted [year] [name of copyright owner]"
REM # 
REM # Contributor(s):
REM # 
REM # If you wish your version of this file to be governed by only the CDDL or
REM # only the GPL Version 2, indicate your decision by adding "[Contributor]
REM # elects to include this software in this distribution under the [CDDL or GPL
REM # Version 2] license."  If you don't indicate a single choice of license, a
REM # recipient has the option to distribute your version of this file under
REM # either the CDDL, the GPL Version 2 or  to extend the choice of license to
REM # its licensees as provided above.  However, if you add GPL Version 2 code
REM # and therefore, elected the GPL Version 2 license, then the option applies
REM # only if the new code is made subject to such option by the copyright holder. 
REM #
REM #
REM # @(#)usermgr.bat	1.4 07/02/07
REM # 
REM #############################################################################


if "%OS%" == "Windows_NT" setlocal

REM Specify additional arguments to the JVM here
set JVM_ARGS=

set _IMQ_HOME=..

if "%1" == "-javahome" goto setjavahome
:resume

if "%JAVA_HOME%" == "" (echo Please set the JAVA_HOME environment variable or use -javahome. & goto end)

set JVM_ARGS=%JVM_ARGS% -Dimq.home=%_IMQ_HOME%

set _classes=%_IMQ_HOME%/../../share/opt/classes
set _mainclass=com.sun.messaging.jmq.jmsserver.auth.usermgr.UserMgr

REM 
REM  Use %* on NT, use %1 %2 .. %9 on win98
REM
if "%OS%" == "Windows_NT" goto winnt

:win98
%JAVA_HOME%\bin\java -cp %_classes% %JVM_ARGS% %_mainclass% %1 %2 %3 %4 %5 %6 %7 %8 %9
goto end

:winnt
%JAVA_HOME%\bin\java -cp %_classes% %JVM_ARGS% %_mainclass% %*
goto end

:setjavahome
set JAVA_HOME=%2
goto resume

:end
if "%OS%" == "Windows_NT" endlocal
