@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
set _task=流向抓取工具
set _runexe=start.vbs
:checkstart
echo "检查进程"
for /f "tokens=5" %%c in ('qprocess.exe ^| find "%_task%"') do ( if %%c==" " ( @echo ) else goto checkag )
goto startsvr
:startsvr
echo ******开始启动程序*******
echo 启动时间 %time% >> restart.log
echo set ws=wscript.createobject("wscript.shell") >> %_runexe%
echo ws.run "流向抓取工具.exe",0,false >> %_runexe%
start /b %_runexe%
echo Wscript.Sleep Wscript.Arguments(0) >%tmp%\delay.vbs
cscript //b //nologo %tmp%\delay.vbs 10000
del %_runexe% /Q
echo *******程序启动完成********
goto checkstart
:checkag
echo Wscript.Sleep Wscript.Arguments(0) >%tmp%\delay.vbs
cscript //b //nologo %tmp%\delay.vbs 10000
goto checkstart
这个是百度到的检查软件是否运行,如没有运行自动运行的批处理语句。现在发现我们项目在进程中并不是项目的可执行文件名,所以此语句检查不到软件运行,反复运行项目文件,请问如何改语句。谢谢!