美文网首页
bat一键启动/停止微服务

bat一键启动/停止微服务

作者: 阿尼奥赛哟 | 来源:发表于2020-08-13 09:47 被阅读0次

    @echo off

    start 1--pig-eureka-start1.bat

    TIMEOUT /T 30

    start 2--pig-config-start2.bat

    TIMEOUT /T 50

    start 3--pig-auth-start3.bat

    TIMEOUT /T 50

    start 4--pig-gateway-start4.bat

    TIMEOUT /T 50

    start 5--pig-upms-service-start5.bat

    @echo off

    set port=1025

    for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (

        echo kill the process %%m who use the port

        taskkill /pid %%m -t -f

        goto q

    )

    :q

    set port=3000

    for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (

        echo kill the process %%m who use the port

        taskkill /pid %%m -t -f

        goto q

    )

    :q

    set port=4001

    for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (

        echo kill the process %%m who use the port

        taskkill /pid %%m -t -f

        goto q

    )

    :q

    set port=9999

    for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (

        echo kill the process %%m who use the port

        taskkill /pid %%m -t -f

        goto q

    )

    :q

    set port=8078

    for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (

        echo kill the process %%m who use the port

        taskkill /pid %%m -t -f

        goto q

    )

    :q

    title 1 pig-eureka

    %1 mshta vbscript:CreateObject("WScript.Shell").Run("%~s0 ::",0,FALSE)(window.close)&&exit

    java -jar -Xms128m -Xmx256m -XX:PermSize=64M -XX:MaxPermSize=128m D:\CityFlood\jar\pig-eureka.jar

    相关文章

      网友评论

          本文标题:bat一键启动/停止微服务

          本文链接:https://www.haomeiwen.com/subject/yzfbdktx.html