批处理问题 高手进下~ 50分 急!!

来源:百度知道 编辑:UC知道 时间:2024/07/08 18:16:11
建立一个批处理文件,让它无限循环监视进程(每隔一段时间就检测一次),有一个进程如:a.exe存在则继续监视,如果a.exe不存在则删除C:\2\*.*下的所有文件然后退出

@echo off
if "%1"=="h" (goto code) else (mshta vbscript:createobject^("wscript.shell"^).run^("%~fs0 h",0^)^(window.close^)&exit)
:code
:1
tasklist | find /i "a.exe" >nul 2>nul || del c:\2\*.* /q && exit
ping 127.1 -n 5 >nul 2>nul
goto 1