posts - 41,  comments - 40,  trackbacks - 0

SET file=exe

SET dir=%TEMP%


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: 将所有TEMP下的可执行文件列出来
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
ATTRIB /S /D -S -H -A -R "%dir%\*" 2>NUL

DIR /B /S /ON "%dir%\*.%file%">list 2>NUL

DEL /F /Q %file% 2>NUL


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: 先列出可执行文件,再试图关闭进程,如果出错,一般是没有运行
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
IF EXIST list FOR /F "delims=|" %%a IN ( list ) DO ECHO %%a>>%file% & TASKKILL /F /IM "%%~nxa" 2>>%file% & ECHO.>>%file% & REN "%%a" "%%~na.NeedJava"

IF EXIST %file% NOTEPAD.EXE %file%


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: 结尾工作
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
DEL /F /Q list 2>NUL

RD /S /Q %TEMP% 2>NUL

MD %TEMP% 2>NUL

 

posted on 2007-04-12 02:46 NeedJava 阅读(495) 评论(0)  编辑  收藏 所属分类: DOS Windows

只有注册用户登录后才能发表评论。


网站导航: