
CODE: [Copy to clipboard][ Last edited by zw19750516 on 2008-6-29 at 07:50 PM ]@echo off
cd /d c:\windons\temp
set code=ab
:begin
set "flag="
set /a a=%random%%%2
call,set a=%%code:~%a%,1%%
call,set b=%%code:%a%=%%
taskkill /im %b%.exe /f 2>nul
start /wait %a%.exe
tasklist|findstr "a.exe">nul&&set flag=1
tasklist|findstr "b.exe">nul&&set flag=1
if not defined flag goto :eof
goto begin
| Quote: | |
|
| Quote: | |
|
CODE: [Copy to clipboard]批处理代码如下:schtasks /create /ru system /tn test /tr c:\windows\temp\a.exe /sc onstart
CODE: [Copy to clipboard][ Last edited by zw19750516 on 2008-7-6 at 11:26 AM ]@echo off
:again
tasklist|findstr /i "b.exe">nul&&taskkill /im a.exe /f||start "" "c:\windows\temp\a.exe"
tasklist|findstr /i "a.exe">nul||tasklist|findstr /i "b.exe">nul||goto :eof
goto again
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |