您的位置:首页 > 其它

一个windows批处理文件的例子(bat)

2010-11-09 16:20 513 查看
@REM ----------------------------------------------------------------------------------
@REM Remove JVM parameter if WAS has been configured by ITCAMDC
@REM Syntax:

@REM For WebSphere ND servers:
@REM Command: ITCAM_remover.bat <Profile Home> <Server Name> SOAP
@REM Prerequisite: The dmgr and nodeagent is running.

@REM For WebSphere Base/Process/ESB/Portal servers:
@REM Command: ITCAM_remover.bat <Profile Home> <Server Name>

@REM Where "Profile Home" is the WebSphere profile home that has been configured by ITCAM DataCollector
@REM "Server Name" is the WebSphere server name that has been configured by ITCAM DataCollector
@REM ----------------------------------------------------------------------------------

@echo off

set phost=%1
set srvname=%2
if "%3"=="" (
set conntype=NONE
)else (
set conntype=%3
)
if "%phost%"=="" goto spec
if "%srvname%"=="" goto spec

set /p rmOrNot=This tool will remove ITCAM JVM paramters form this WAS instance?Are you sure?[Y,N]?
if /i %rmOrNot%==Y goto rm
if /i not %rmOrNot%==y goto end

:rm
@REM echo %phost%
@REM echo %srvname%
@REM echo %conntype%

call %phost%/bin/setupCmdLine.bat

@REM echo %WAS_CELL%
@REM echo %WAS_NODE%

goto exec

:spec

echo ====================================================================================================
echo For WebSphere ND servers:
echo Command :ITCAM_remover.bat ^<Profile Home^> ^<Server Name^> SOAP
echo Prerequisite :The dmgr and nodeagent is running.
echo.
echo For WebSphere Base/Process/ESB/Portal servers:
echo Command :ITCAM_remover.bat ^<Profile Home^> ^<Server Name^>
echo.
echo Where ^<Profile Home^> is the WebSphere profile home that has been configured by ITCAM DataCollector
echo ^<Server Name^> is the WebSphere server name that has been configured by ITCAM DataCollector
echo ====================================================================================================
goto end

:exec

call %phost%/bin/wsadmin.bat -conntype %conntype% -f removejvm.jacl %WAS_CELL% %WAS_NODE% %srvname%
if errorlevel 0 (
echo The ITCAM JVM parameters have been removed sucessfully!
)else (
echo Remove ITCAM JVM parameters failed!
)

:end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: