代码如下:
@echo off
:: code by bg
set virus=
for %%f in (C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) do (
if exist %%f:\nul (
if exist %%f:\autorun.inf (
dir %%f:|find "0 可用字节">nul
if errorlevel 1 (
attrib -s -h %%f:\autorun.inf>nul
for /f "tokens=2 delims==," %%n in (%%f:\autorun.inf) do (
if exist %%f:\%%n (
tasklist|find "%%n">nul
if not errorlevel 1 (
echo 恭喜你,机子中毒了
echo 现在求老天保佑你吧。
taskkill /im /f /t %%n
)
attrib -s -h %%f:\%%n
del %%f:\%%n /f/q
echo 删除病毒文件--%%f:\%%n
set virus=1
)
)
del %%f:\autorun.inf /f/q
)
)
)
)
)
)
if "%virus%"=="1" goto norun
exit
:norun
shutdown -l
@echo off
:: code by bg
set virus=
for %%f in (C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) do (
if exist %%f:\nul (
if exist %%f:\autorun.inf (
dir %%f:|find "0 可用字节">nul
if errorlevel 1 (
attrib -s -h %%f:\autorun.inf>nul
for /f "tokens=2 delims==," %%n in (%%f:\autorun.inf) do (
if exist %%f:\%%n (
tasklist|find "%%n">nul
if not errorlevel 1 (
echo 恭喜你,机子中毒了
echo 现在求老天保佑你吧。
taskkill /im /f /t %%n
)
attrib -s -h %%f:\%%n
del %%f:\%%n /f/q
echo 删除病毒文件--%%f:\%%n
set virus=1
)
)
del %%f:\autorun.inf /f/q
)
)
)
)
)
)
if "%virus%"=="1" goto norun
exit
:norun
shutdown -l
