bat判断进程是否存在


setlocal enabledelayedexpansion
@echo off
cd /d D:\work\tool\nginx-1.13.7

set hasit=no
for /F "tokens=1*" %%a in ('tasklist /nh /fi "imagename eq nginx.exe"') do if %%a == nginx.exe set hasit=yes
if %hasit% == yes goto end
start nginx.exe
:end
set hasit=

nginx.exe -s reload

 

 

echo "结束进程"
TASKKILL /F /IM node.exe

echo "启动node"
cd /d D:\workIdel\tm_edc5.0

cnpm run deploy


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM