shutdown.bat 483 B

1234567891011121314151617181920212223
  1. @title HertzBeat
  2. @echo off
  3. setlocal enabledelayedexpansion
  4. rem 项目名称
  5. set SERVER_NAME="${project.artifactId}"
  6. rem 应用的端口号
  7. set SERVER_PORT=1157
  8. echo Start shutdown HertzBeat %SERVER_NAME%
  9. for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%SERVER_PORT%"') do (
  10. echo kill the process %%m who use the port
  11. taskkill /pid %%m -t -f
  12. echo Shutdown HertzBeat %SERVER_NAME% Success!
  13. goto q
  14. )
  15. echo Faild shutdown HertzBeat %SERVER_NAME%
  16. :q
  17. pause