找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 20844|回复: 1

[其他] 自动对所有盘符进行AutoRun.inf免疫文件夹生成

[复制链接]
发表于 2010-4-11 17:22:02 | 显示全部楼层 |阅读模式
  1. @echo off
  2. ::Made by bathome.net [bat_fan] 04:38 2010/4/11
  3. ::用到了三点小技巧
  4. ::1,建立畸形文件..\
  5. ::2,创建系统保留设备名文件,这里是con,其他的如ptr、nul皆可用
  6. ::3,判断是否存在盘符,技巧很明显...
  7. ::另外对原本存在的AutoRun.inf文件进行了处理...
  8. set allDri=C D E F G H I J K L M N O P Q R S T U V W X Y Z
  9. :start
  10. cls
  11. for %%i in (%allDri%) do (
  12. if exist %%i:\con (
  13. cd /d %%i:\
  14. dir /a-d AutoRun.inf >nul 2>nul&&del /a /q /f [url=file://\\.\%%i:\AutoRun.inf]\\.\%%i:\AutoRun.inf[/url] >nul 2>nul
  15. dir /ad AutoRun.inf >nul 2>nul||(md AutoRun.inf&&cd AutoRun.inf&&md bat_fan..\&&cd bat_fa~1&&echo wow>up-Hi.txt&&cd ..&&copy /y %systemroot%\notepad.exe [url=file://\\.\%%i:\AutoRun.inf\con.txt&&cd]\\.\%%i:\AutoRun.inf\con.txt&&cd[/url] \&&attrib +s +r +h AutoRun.inf&&echo %%i盘已经免疫...>>%temp%\123.txt)
  16. ))
  17. cls
  18. color 0a
  19. dir /a %temp%\123.txt >nul 2>nul&&(type %temp%\123.txt&&del /a /q /f %temp%\123.txt)||echo 本次免疫程序运行未产生免疫文件夹,可能是以前已经免疫过了。
  20. :choice_Want
  21. set /p you=退出[Q]、取消免疫[C]:
  22. if /i "%you%" equ "Q" goto end
  23. if /i "%you%" equ "C" goto cancel
  24. echo.
  25. echo 输入有错误,请重新输入...
  26. echo.
  27. goto choice_Want
  28. :cancel
  29. cls
  30. for %%i in (%allDri%) do (
  31. dir /ad %%i:\AutoRun.inf >nul 2>nul&&rd /q /s [url=file://\\.\%%i:\AutoRun.inf&&echo]\\.\%%i:\AutoRun.inf&&echo[/url] %%i盘已取消免疫...>>%temp%\321.txt
  32. )
  33. dir /a %temp%\321.txt >nul 2>nul &&(type %temp%\321.txt&&del /a /q /f %temp%\321.txt)||echo 本次免疫程序运行未删除免疫文件夹,最可能就是以前根本就没有免疫过。
  34. :again
  35. set /p twice=退出[Q]、重新免疫[T]
  36. if /i "%twice%" equ "T" goto start
  37. :end
  38. cls
  39. echo Made by bathome.net [bat_fan],谢谢你的使用...
  40. pause>nul
复制代码
发表于 2010-4-11 18:49:27 | 显示全部楼层
再去学习一下怎么使用code标签吧
http://bbs.bathome.net/thread-404-1-1.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-20 08:25 , Processed in 0.018386 second(s), 8 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表