应朋友的要求帮忙写一个删除host自动播放病毒的批处理..沉默一晚..把论坛翻了一遍..写完了..总觉得有些杂..很多地方应该可以减少的...请各位帮忙检查一下..
@echo off
echo 此程序用于删除右键自动播放的svchost.exe病毒
echo 请稍等.....正在删除病毒文件
::首先结束病毒进程
:taskkill
tasklist >tasklist.txt
findstr /i "temp1.exe temp2.exe" tasklist.txt &&taskkill /f /im temp1.exe /im temp2.exe >nul 2>nul
del tasklist.txt
::删除病毒启动注册表和盘符自动播放
:delreg
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows" /v "load" /f >nul 2>nul
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows" /v "load" /t REG_SZ /d "" /f >nul 2>nul
reg export "hkcu\software\microsoft\windows\currentversion\explorer\mountpoints2" delreg.reg >nul 2>nul
find /i "autorun" delreg.reg >temp.txt
for /f "skip=2 tokens=8 delims=\" %%a in (temp.txt) do reg delete HKCU\software\microsoft\windows\currentversion\explorer\mountpoints2\%%a\AUTORUN /f
del delreg.reg
del temp.txt
::删除病毒文件
:del
for %%l in (%systemroot% %systemroot%\system32) do (
for %%m in (autorun.inf host.exe copy.exe temp1.exe temp2.exe) do (
attrib %%l\%%m -r -s >nul 2>nul
del %%l\%%m /f /s /a :h >nul 2>nul
)
)
for %%i 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 (
%%i: >nul 2>nul||if errorlevel=1 goto ok
for %%j in (autorun.inf host.exe copy.exe folder.exe) do (
attrib %%i:\%%j -r -s >nul 2>nul
del %%i:\%%j /f /s /a :h >nul 2>nul
)
)
:ok
@echo 删除完成...按任意键退出
pause >nul
goto :eof
──────────────── 版务记录 ────────────────
执行:namejm
原标题:第一个批处理```请你们检查..
说明:因标题过于模糊,不便于论坛的搜索和管理,请在三日内修改标题。
提示:修改标题请在当前帖的右下脚点 编辑,
修改完毕之后按 编辑帖子 即可。
处罚:因刚脱离论坛新人阶段不久,暂时不予处罚;若三日之后尚未修改标题,将扣除
2点积分,以示惩罚,并由版主强制修改标题。请点击这里阅读论坛发帖规定,
以避免在今后的讨论中违规发帖。
──────────────── 版务记录 ────────────────
Last edited by namejm on 2007-1-14 at 09:38 PM ]