Autorun病毒清除工具

  1. @Echo Off
  2. color 2f
  3. title Autorun 病毒清除工具-By Phexon
  4. Rem 杀进程
  5. taskkill /F /IM SocksA.exe /IM SVOHOST.exe /IM AdobeR.exe /IM ravmone.exe /IM wincfgs.exe /IM doc.exe /IM rose.exe /IM sxs.exe /IM autorun.exe /IM KB20060111.exe /IM tel.xls.exe>nul 2>nul
  6. :clearauto
  7. cls
  8. Echo.
  9. Echo Autorun 病毒清除工具
  10. Echo.
  11. Echo.
  12. Echo.
  13. Echo 制作:Phexon
  14. Echo.
  15. Echo 本程序运行后自动清除每个盘符下面的Autorun病毒
  16. Echo 本程序原理是基于读取每个盘符下的Autorun.inf相关字段
  17. Echo.
  18. Echo [1] 仅仅删除所有盘符下的 Autorun 病毒
  19. Echo [2] 删除所有盘符下的 Autorun 病毒并且建立同名免疫目录(推荐!)
  20. Echo [3] 禁用系统的 Autorun 机制以避免 Autorun 病毒的再次感染
  21. Echo [4] 取消所有盘符的 Autorun 病毒免疫
  22. Echo [5] 删除并免疫指定盘符的 Autorun 病毒
  23. Echo [6] 取消免疫指定盘符
  24. Echo [7] 恢复相关注册表项默认值
  25. Echo [0] 退出
  26. Echo.
  27. Set /p clearslt= 请输入您的选择(1/2/3/4/5/6/7/0):
  28. If "%clearslt%"=="" Goto clearauto
  29. If "%clearslt%"=="1" Goto clearauto1
  30. If "%clearslt%"=="2" Goto clearauto2
  31. If "%clearslt%"=="3" Goto clearauto3
  32. If "%clearslt%"=="4" Goto clearauto4
  33. If "%clearslt%"=="5" Goto clearauto5
  34. If "%clearslt%"=="6" Goto clearauto6
  35. If "%clearslt%"=="7" Goto clearauto7
  36. If "%clearslt%"=="0" Exit
  37. :clearauto1
  38. taskkill /F /IM SocksA.exe /IM SVOHOST.exe /IM AdobeR.exe /IM ravmone.exe /IM wincfgs.exe /IM doc.exe /IM rose.exe /IM sxs.exe /IM autorun.exe /IM KB20060111.exe /IM tel.xls.exe>nul 2>nul
  39. For %%a 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 (
  40. fsutil fsinfo drivetype %%a: |find /i "固定驱动器" && (
  41. For /f "tokens=2 delims==" %%b In (%%a:\autorun.inf) Do Del /a /f /q "%%a:\%%b" >nul 2>nul
  42. Del /a /f /q %%a:\autorun.inf >nul 2>nul
  43. ) >nul 2>nul
  44. fsutil fsinfo drivetype %%a: |find /i "可移动驱动器" && (
  45. For /f "tokens=2 delims==" %%b In (%%a:\autorun.inf) Do Del /a /f /q "%%a:\%%b" >nul 2>nul
  46. Del /a /f /q %%a:\autorun.inf >nul 2>nul
  47. ) >nul 2>nul
  48. )
  49. cls
  50. Echo Autorun 病毒清除完毕,任意键返回……
  51. pause>nul
  52. Goto clearauto
  53. :clearauto2
  54. taskkill /F /IM SocksA.exe /IM SVOHOST.exe /IM AdobeR.exe /IM ravmone.exe /IM wincfgs.exe /IM doc.exe /IM rose.exe /IM sxs.exe /IM autorun.exe /IM KB20060111.exe /IM tel.xls.exe>nul 2>nul
  55. For %%a 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 (
  56. fsutil fsinfo drivetype %%a: |find /i "固定驱动器" && (
  57. For /f "tokens=2 delims==" %%b In (%%a:\autorun.inf) Do Del /a /f /q "%%a:\%%b" & md "%%a:\%%b\免疫目录不要删除!...\" & attrib +s +h +r "%%a:\%%b" & Echo Y|cacls "%%a:\%%b" /T /C /P everyone:N >nul 2>nul
  58. Del /a /f /q %%a:\autorun.inf & md "%%a:\autorun.inf\免疫目录不要删除!...\" & attrib +s +h +r %%a:\autorun.inf & Echo Y|cacls "%%a:\autorun.inf" /T /C /P everyone:N >nul 2>nul
  59. ) >nul 2>nul
  60. fsutil fsinfo drivetype %%a: |find /i "可移动驱动器" && (
  61. For /f "tokens=2 delims==" %%b In (%%a:\autorun.inf) Do Del /a /f /q "%%a:\%%b" & md "%%a:\%%b\免疫目录不要删除!...\" & attrib +s +h +r "%%a:\%%b" & Echo Y|cacls "%%a:\%%b" /T /C /P everyone:N >nul 2>nul
  62. Del /a /f /q %%a:\autorun.inf & md "%%a:\autorun.inf\免疫目录不要删除!...\" & attrib +s +h +r %%a:\autorun.inf & Echo Y|cacls "%%a:\autorun.inf" /T /C /P everyone:N >nul 2>nul
  63. ) >nul 2>nul
  64. )
  65. cls
  66. Echo Autorun 病毒清除并免疫完毕,任意键返回……
  67. pause>nul
  68. Goto clearauto
  69. :clearauto3
  70. cls
  71. Echo.
  72. Echo 正在停止相关服务……
  73. Echo.
  74. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer" /v NoDriveTypeAutoRun /t REG_DWORD /d 0x000000ff /f >nul 2>nul
  75. reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer" /v NoDriveTypeAutoRun /t REG_DWORD /d 0x000000ff /f >nul 2>nul
  76. net stop ShellHWDetection >nul 2>nul
  77. sc config ShellHWDetection start= disabled >nul 2>nul
  78. Rem 添加防止从回收站或仿回收站的目录中直接运行可执行文件的策略
  79. Set REGPATH=HKLM\SOFTWARE\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Paths
  80. Set SFLAG=/v SaferFlags /t REG_DWORD /d 0x00000000 /f
  81. Set IDATA=/f /v ItemData /d "?:\Recyc?
  82. reg add %REGPATH%\{00ffa5bf-abe7-4901-aacf-4f58aa31217a} %SFLAG%>nul
  83. reg add %REGPATH%\{00ffa5bf-abe7-4901-aacf-4f58aa31217a} %IDATA%\*\*\*\*.*">nul
  84. reg add %REGPATH%\{41fe7eed-c47a-46f6-840a-240796fd03cf} %SFLAG%>nul
  85. reg add %REGPATH%\{41fe7eed-c47a-46f6-840a-240796fd03cf} %IDATA%\*\*\*.*">nul
  86. reg add %REGPATH%\{4e93c91c-a40e-462e-9b89-3b0832d222d9} %SFLAG%>nul
  87. reg add %REGPATH%\{4e93c91c-a40e-462e-9b89-3b0832d222d9} %IDATA%\*.*">nul
  88. reg add %REGPATH%\{5bfc100b-d3fb-450e-88ec-6819ab56a9ff} %SFLAG%>nul
  89. reg add %REGPATH%\{5bfc100b-d3fb-450e-88ec-6819ab56a9ff} %IDATA%\*\*\*\*.*">nul
  90. reg add %REGPATH%\{5c5e2bcd-7057-43f4-830c-e4361d2afadd} %SFLAG%>nul
  91. reg add %REGPATH%\{5c5e2bcd-7057-43f4-830c-e4361d2afadd} %IDATA%\*.*">nul
  92. reg add %REGPATH%\{5f8ff865-0638-4c6e-98de-923e7bc6b330} %SFLAG%>nul
  93. reg add %REGPATH%\{5f8ff865-0638-4c6e-98de-923e7bc6b330} %IDATA%\*\*\*.*">nul
  94. reg add %REGPATH%\{649c1429-0e79-453c-abe9-b5682e035ae7} %SFLAG%>nul
  95. reg add %REGPATH%\{649c1429-0e79-453c-abe9-b5682e035ae7} %IDATA%\*\*.*">nul
  96. reg add %REGPATH%\{718f54b2-c669-4d7b-aeff-18d69f100034} %SFLAG%>nul
  97. reg add %REGPATH%\{718f54b2-c669-4d7b-aeff-18d69f100034} %IDATA%\*\*.*">nul
  98. reg add %REGPATH%\{8385d9d2-80c9-4ac1-a100-ed3e62863d97} %SFLAG%>nul
  99. reg add %REGPATH%\{8385d9d2-80c9-4ac1-a100-ed3e62863d97} %IDATA%\*.*">nul
  100. reg add %REGPATH%\{af2a4fcf-441c-421e-9663-52cd3502cfd7} %SFLAG%>nul
  101. reg add %REGPATH%\{af2a4fcf-441c-421e-9663-52cd3502cfd7} %IDATA%\*\*\*.*">nul
  102. reg add %REGPATH%\{b997f4b2-c037-4e97-b051-31f5d86df802} %SFLAG%>nul
  103. reg add %REGPATH%\{b997f4b2-c037-4e97-b051-31f5d86df802} %IDATA%\*\*.*">nul
  104. reg add %REGPATH%\{d4e7b6ff-d76f-407f-b8bb-ea0835f5babc} %SFLAG%>nul
  105. reg add %REGPATH%\{d4e7b6ff-d76f-407f-b8bb-ea0835f5babc} /f /v ItemData /d "RECYC*.*">nul
  106. Rem 清除喜欢利用回收站的移动磁盘自动运行病毒
  107. For %%a 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 (
  108. For %%b In (exe pif com) Do (
  109. Echo Y|cacls "%%a:\Recycler\*.%%b" /C /T /P everyone:F>nul 2>nul&Echo Y|cacls "%%a:\Recycled\*.%%b" /C /T /P everyone:F>nul 2>nul&Echo Y|cacls "%%a:\Recycled\Recycled\*.%%b" /C /T /P everyone:F>nul 2>nul
  110. Del /A /F /S /Q "%%a:\Recycler\*.%%b">nul 2>nul&Del /A /F /S /Q "%%a:\Recycled\*.%%b">nul 2>nul&Del /A /F /S /Q "%%a:\Recycled\Recycled\*.%%b">nul 2>nul
  111. )
  112. )>nul 2>nul
  113. Echo.
  114. Echo 相关服务已停止并禁用,任意键返回……
  115. pause >nul
  116. Goto clearauto
  117. :clearauto4
  118. For %%a 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 (
  119. fsutil fsinfo drivetype %%a: |find /i "固定驱动器" && (
  120. cacls "%%a:\autorun.inf" /T /C /P everyone:F&Del /a /f /q "%%a:\autorun.inf" & rd /s /q "%%a:\autorun.inf">nul 2>nul
  121. )>nul 2>nul
  122. fsutil fsinfo drivetype %%a: |find /i "可移动驱动器" && (
  123. cacls "%%a:\autorun.inf" /T /C /P everyone:F&Del /a /f /q "%%a:\autorun.inf" & rd /s /q "%%a:\autorun.inf">nul 2>nul
  124. )>nul 2>nul
  125. )
  126. cls
  127. Echo.
  128. Echo 已经解除全部盘符的免疫,任意键返回……
  129. pause>nul
  130. Goto clearauto
  131. :clearauto5
  132. cls
  133. Echo.
  134. Set /p pf= 请输入盘符,如"F:"(不包括引号)
  135. Echo 即将免疫%pf%盘……|find /i ":"||Set pf=%pf%:&&Echo 即将免疫%pf%盘……
  136. taskkill /F /IM SocksA.exe /IM SVOHOST.exe /IM AdobeR.exe /IM ravmone.exe /IM wincfgs.exe /IM doc.exe /IM rose.exe /IM sxs.exe /IM autorun.exe /IM KB20060111.exe /IM tel.xls.exe>nul 2>nul
  137. fsutil fsinfo drivetype %pf% |find /i "固定驱动器" && (
  138. For /f "tokens=2 delims==" %%a In (%pf%\autorun.inf) Do Del /a /f /q "%pf%\%%a" & md "%pf%\%%a\免疫目录不要删除!...\" & attrib +s +h +r "%pf%\%%a" & Echo Y|cacls "%pf%\%%a" /T /C /P everyone:N >nul 2>nul
  139. Del /a /f /q %pf%\autorun.inf & md "%pf%\autorun.inf\免疫目录不要删除!...\" & attrib +s +h +r %pf%\autorun.inf & Echo Y|cacls "%pf%\autorun.inf" /T /C /P everyone:N >nul 2>nul
  140. Goto DoneclearAuto
  141. ) >nul 2>nul
  142. fsutil fsinfo drivetype %pf% |find /i "可移动驱动器" && (
  143. For /f "tokens=2 delims==" %%a In (%pf%\autorun.inf) Do Del /a /f /q "%pf%\%%a" & md "%pf%\%%a\免疫目录不要删除!...\" & attrib +s +h +r "%pf%\%%a" & Echo Y|cacls "%pf%\%%a" /T /C /P everyone:N >nul 2>nul
  144. Del /a /f /q %pf%\autorun.inf & md "%pf%\autorun.inf\免疫目录不要删除!...\" & attrib +s +h +r %pf%\autorun.inf & Echo Y|cacls "%pf%\autorun.inf" /T /C /P everyone:N >nul 2>nul
  145. Goto DoneclearAuto
  146. ) >nul 2>nul
  147. Echo.
  148. Echo 您所输入的盘符不存在或者是只读设备,
  149. Echo 请重新输入
  150. Goto clearauto5
  151. :DoneclearAuto
  152. cls
  153. Echo.
  154. Echo 指定的磁盘 %pf% 已经成功进行了 Autorun 病毒的清除及免疫
  155. Echo.
  156. Echo [1] 继续免疫其他磁盘
  157. Echo [0] 返回主菜单
  158. Set /p choice= 请输入您的选择(1/0):
  159. If %choice%="" Goto DoneclearAuto
  160. If %choice%="1" Goto clearauto5
  161. If %choice%="0" Goto clearauto
  162. :clearauto6
  163. cls
  164. Echo.
  165. Set /p pf= 请输入盘符,如"F:"(不包括引号)
  166. Echo 即将取消免疫%pf%盘……|find /i ":"||Set pf=%pf%:&&Echo 即将取消免疫%pf%盘……
  167. fsutil fsinfo drivetype %pf% |find /i "固定驱动器" && (
  168. cacls "%pf%\autorun.inf" /T /C /P everyone:F&Del /a /f /q "%pf%\autorun.inf" & rd /s /q "%pf%\autorun.inf">nul 2>nul
  169. Goto DoneUnauto
  170. )>nul 2>nul
  171. fsutil fsinfo drivetype %pf% |find /i "可移动驱动器" && (
  172. cacls "%pf%\autorun.inf" /T /C /P everyone:F&Del /a /f /q "%pf%\autorun.inf" & rd /s /q "%pf%\autorun.inf">nul 2>nul
  173. Goto DoneUnauto
  174. )>nul 2>nul
  175. Echo.
  176. Echo 您所输入的盘符不存在或者是只读设备,
  177. Echo 请重新输入
  178. Goto clearauto6
  179. :DoneUnauto
  180. cls
  181. Echo.
  182. Echo 指定的磁盘 %pf% 已经成功解除了 Autorun 病毒免疫
  183. Echo.
  184. Echo [1] 继续解除免疫其他磁盘
  185. Echo [0] 返回主菜单
  186. Set choice=
  187. Set /p choice= 请输入您的选择(1/0):
  188. If %choice%="" Goto DoneUnauto
  189. If %choice%="1" Goto clearauto6
  190. If %choice%="0" Goto clearauto
  191. :clearauto7
  192. cls
  193. Rem 防止在资源管理器中彻底隐藏文件、禁止文件等
  194. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL" /v CheckedValue /t REG_DWORD /d 0x00000001 /f>nul 2>nul
  195. reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2" /f>nul 2>nul
  196. reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /f>nul 2>nul
  197. reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v DisallowRun /f>nul 2>nul
  198. Rem 防止转移启动组位置
  199. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Startup /d "%USERPROFILE%\「开始」菜单\程序\启动" /f>nul 2>nul
  200. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Common Startup" /d "%ALLUSERSPROFILE%\「开始」菜单\程序\启动" /f>nul 2>nul
  201. Echo.
  202. Echo 相关注册表恢复完毕,任意键返回……
  203. pause>nul
  204. Goto clearauto