stop.bat 595 B

123456789101112131415
  1. @echo off
  2. set url1="%~dp0\third\nginx\nginx.exe"
  3. set url2="%~dp0\third\ffmpeg\ffmpeg.exe"
  4. echo 本程序用来手动关闭nginx.exe进程和ffmpeg.exe进程,并不会关闭hls服务,所以一旦关闭nginx.exe后,hls服务将无法正常访问,需要用户手动关闭start.bat窗口!
  5. set /p var="请选择y/n:"
  6. if /i "%var%"=="y" (
  7. for /f "tokens=1,2" %%a in ('"wmic process where name="nginx.exe" get processid,executablepath| findstr /C:%url1%"') do (
  8. taskkill /f /pid %%b
  9. )
  10. for /f "tokens=1,2" %%a in ('"wmic process where name="ffmpeg.exe" get processid,executablepath| findstr /C:%url2%"') do (
  11. taskkill /f /pid %%b
  12. )
  13. )
  14. pause