首页 > 系统服务 > 详细

bat判断进程是否存在

时间:2018-01-04 15:42:56      阅读:343      评论:0      收藏:0      [点我收藏+]

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

bat判断进程是否存在

原文:https://www.cnblogs.com/sprinng/p/8193441.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!