| 
 | 
 
@echo off 
dir/b D:\网络游戏\QQ幻想\*.exe >游戏进程.txt 
for /f %%a in (游戏路径.txt) do set 游戏路径=%%a 
for /f %%b in (游戏进程.txt) do set 游戏进程=%%b 
tasklist > a.txt 
type a.txt | find /i "%游戏进程%" && goto b 
goto f 
:a 
upgame.exe /now 1 e:\sysset\ d:\sysset\ 
start %游戏路径% 
goto c 
:b 
start %游戏路径% 
goto c 
:c 
del /s/q a.txt 
 
我原来写的,就不行. 
我想这样的效果: 
当我运行游戏路径.txt里的D:\网络游戏\QQ幻想\qqfo.exe,如果再运行这个批处理时,就会检测到本目录下的某个进程已经运行了并直接运行路径:b 
start %游戏路径% 
,而不用运行更新:a 
upgame.exe /now 1 e:\sysset\ d:\sysset\ 
. |   
 
 
 
 |