赞
踩
- @echo off
- set operation=%1
- set jarName=%2
- if "%operation%"=="start" (
- echo "Start %jarName% ..."
- start javaw -jar %jarName%
- echo "Start %jarName% Success..."
- jps -l|findStr "%jarName%"
- ) else if "%operation%"=="stop" (
- echo "Stop %jarName%"
- for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %jarName%`) do (
- taskkill /f /pid %%a
- )
- echo "Stop %jarName% Success..."
- ) else if "%operation%"=="restart" (
- echo "ReStart %jarName% ..."
- for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %jarName%`) do (
- taskkill /f /pid %%a
- echo "Restart %jarName% ..."
- start javaw -jar %jarName%
- jps -l|findStr "%jarName%"
- )
- echo "Restart %jarName% Success..."
- ) else if "%operation%"=="status" (
- jps -l|findStr "%jarName%"
- ) else (
- echo "Usage: execJar.bat [start|stop|restart|status]"
- )
- @echo off
- set program=%1
- echo program: %program%
- for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %program%`) do (
- taskkill /f /pid %pid%
- )
- @echo off
- start javaw -jar %1
- jps -l|findStr %1
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。