批处理检测并打开多个程序的bat
批处理文件,可以按顺序打开多个程序,并检测是否运行,已经运行的可以跳过
代码如下
@echo off
mode con cols=20 lines=10
color 4A
title=启动软件
:a
tasklist|find /i \"1.exe\"&&(echo 程序1:运行成功&goto b)||(start \"\" \"D:\\***\\**\\1.exe\"&ping -n 3 127.1>nul&goto a)
:b
tasklist|find /i \"2.exe\"&&(echo 程序2:启动成功&goto exit)||(start \"\" \"D:\\**\\**\\2.exe\"&ping -n 3 127.1>nul&goto b)
:exit
echo 5秒后自动关闭&ping -n 5 127.1>nul



