![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-08-06 10:28 |
共 48,039 主题排行 / 350,124 发帖 / 今日 0 篇 / 48,251 会员排行 |
| DOS批处理 & 脚本技术(批处理室) » 发一个反U免疫批处理 |
| 可打印版本 981 / 9 |
| 第1楼 w1314ich | 发表于 2007-11-04 19:35 |
| 中级用户 发帖 119 积分 234 | |
|
发一个反U免疫批处理 本人大菜一个,批处理代码虽然极其简单,但我也很辛苦的研究了很久~~
以下代码可对一般的在磁盘根目录建立一个无法删除autorun.inf免疫方法起到反免疫的作用,希望有高手帮我精简一下,可能有点复杂了,谢谢~ @echo off set AllDrive=c d e f g h i j k l m n o p q r s t u v w x y z for %%a in (%AllDrive%) do ( attrib %%a:\autorun.inf -s -r -h dir %%a:\autorun.inf /b >>c:\auto.txt for /f "tokens=*" %%i in (c:\auto.txt) do ( rd %%a:\autorun.inf\"%%i".\ rd %%a:\autorun.inf ) ) del c:\auto.txt |
|
| 第2楼 RocheChild | 发表于 2007-11-04 21:42 |
| 初级用户 发帖 44 积分 110 | |
|
如果人家程序创建autorun.inf的时候,先去除你的系统属性,然后删除你的autorun.inf,再安装他的autorun.inf不行吗?
|
|
| 第3楼 afeichai | 发表于 2007-11-05 23:03 |
| 初级用户 发帖 78 积分 171 | |
|
好像是深山红叶的,具体的我忘记了。可以加NTFS权限的
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 Del /a /f /q %%a:\autorun.inf>nul 2>nul & echo Y|cacls "%%a:\autorun.inf" /T /C /P everyone:F>nul 2>nul & rd /s /q %%a:\autorun.inf\ >nul 2>nul & md "%%a:\autorun.inf\U盘病毒免疫...\">nul 2>nul & attrib +s +h +r %%a:\autorun.inf >nul 2>nul& echo Y|cacls "%%a:\autorun.inf" /T /C /P everyone:N >nul 2>nul |
|
| 第4楼 putao | 发表于 2007-11-05 23:31 |
| 初级用户 发帖 41 积分 80 | |
学习了Originally posted by afeichai at 2007-11-5 11:03 PM: 学到了~正在想此法呢~ |
|
| 第5楼 putao | 发表于 2007-11-05 23:37 |
| 初级用户 发帖 41 积分 80 | |
|
还有个问题! 不过好象U盘没法加ntfs权限呀
|
|
| 第6楼 bozhenguan | 发表于 2007-11-08 10:21 |
| 新手上路 发帖 7 积分 16 | |
|
貌似楼主写得太多了。。。。我这个试试 for /f "delims=驱动器:\" %%i in ('fsutil fsinfo drives^|find /v ""') do rd /s /q %%i:\autorun.inf
一句话全盘通杀~ |
|
| 第7楼 bozhenguan | 发表于 2007-11-08 10:25 |
| 新手上路 发帖 7 积分 16 | |
|
另附上我写的全盘免疫 for /f "delims=驱动器A:\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
del /f /q /a: %%i:\autorun.inf rd /s /q %%i:\autorun.inf md %%i:\autorun.inf\系统修复工具!QQ276365857....\ ) |
|
| 第8楼 wert123 | 发表于 2007-11-08 15:10 |
| 中级用户 发帖 135 积分 301 | |
|
@echo off
cls echo 按 S 键删除Autorun.inf并进行免疫 echo. echo 按 D 键删除免疫程序 echo. echo 按其他任意键退出 echo. echo. SET Choice= SET /P Choice= 请选择要进行的操作: IF /I '%Choice:~0,1%'=='s' GOTO setup IF /I '%Choice:~0,1%'=='d' GOTO Delset IF /I '%Choice:~0,1%'=='q' GOTO Exit exit :Setup taskkill /im explorer.exe /f 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 @( if exist %%a: ( rd %%a:\autorun.inf /s /q del %%a:\autorun.inf /f /q mkdir %%a:\autorun.inf mkdir %%a:\autorun.inf\"病毒免疫勿删除../" attrib +h +r +s %%a:\autorun.inf ) ) start explorer.exe 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 ( if exist %%a:\nul ( >1.vbs echo msgbox^ "%%a:免疫成功",64,"提示:" 1.vbs ) ) del 1.vbs echo. echo. echo 按任意键退出... pause>nul exit :delset 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 @( If Exist %%a: ( rd %%a:\autorun.inf /s /q ) ) echo. echo. echo 操作完毕,按任意键退出... pause>nul exit ============================================================== 上面的这句话 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 ( if exist %%a:\nul ( >1.vbs echo msgbox^ "%%a:免疫成功",64,"提示:" 1.vbs ) ) 中的if exist %%a:\nul 怎么整出个nul,有nul就免疫成功,这里的nul是什么意思,不是空的意思么 [ Last edited by wert123 on 2007-11-8 at 03:12 PM ] |
|
| 第9楼 wert123 | 发表于 2007-11-09 13:07 |
| 中级用户 发帖 135 积分 301 | |
|
8楼有问题,抬哈
|
|
| 第10楼 kootoo | 发表于 2007-11-09 22:40 |
| 初级用户 发帖 11 积分 28 来自 苏州 | |
|
不知道啊有错误
@echo off&setlocal EnableDelayedExpansion color 8B title U盘病毒免疫 echo -------------=======下面进行U盘病毒免疫=======------------- echo 如果你的U盘装过其他U盘病毒免疫软件,则不必装这个. echo 如果的注册表被禁用,任务管理器被禁用,隐藏文件看不见,你可尝试使用. echo 确认使用请输入Y,否则关闭退出 set /p pass= if "%pass%"=="y" ( for /f "skip=1 delims=\ tokens=1,2" %%i in ('fsutil fsinfo drives ^| find ":"') do ((for /f "delims= tokens=1" %%d in ('dir %%i /ah /b ^| find ".exe"') do del /f /q /ah "%%i\%%d" & attrib -s -h "%%i\%%~nd">nul) & %%i & del /q /ah autorun.* & md %%i\autorun.inf >nul & cd %%i\autorun.inf >nul & md g..\\ >nul & cd .. & attrib +s +h autorun.inf>nul)>nul del /q /ah c:\autorun.* & md c:\autorun.inf >nul& cd c:\autorun.inf >nul& md g..\\ >nul& cd .. & attrib +s +h autorun.inf>nul echo U盘病毒免疫完成!) else goto :eof rem 修改注册表 reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v nofolderoptions /t reg_dword /d 0 /f >nul reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v noviewondrive /t reg_dword /d 0 /f >nul reg Add HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\NOHIDDEN /v CheckedValue /t reg_dword /d 2 /f >nul reg Add HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\NOHIDDEN /v DefaultValue /t reg_dword /d 2 /f >nul reg Add HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL /v CheckedValue /t reg_dword /d 1 /f >nul reg Add HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL /v DefaultValue /t reg_dword /d 2 /f >nul reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\system /v DisableTaskMgr /t reg_dword /d 0 /f >nul reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\system /v DisableRegistryTools /t reg_dword /d 0 /f >nul reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer /v NoDrives /t reg_dword /d 0 /F >nul reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer /v NoDriveTypeAutoRun /t reg_dword /d 255 /F >nul reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer /v NoDrives /t reg_dword /d 0 /F >nul reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer /v NoDriveTypeAutoRun /t reg_dword /d 255 /F >nul echo Writed by SAgE &pause |
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |