当前位置:DOS资源站资料中心批处理教程 → 用批处理自动播放防病毒免疫

用批处理自动播放防病毒免疫

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-4-16 21:35:55

echo off&title DOS资源站 www.cmdos.net
cls
color 0b
mode con: cols=63 lines=25
echo         开始自动播放防毒疫苗注入...
echo     注意:在NTFS系统格式下防毒疫苗更安全
echo ==============================================================
echo     免疫本地硬盘请选择1
echo     免疫移动优盘请选择2
echo     解除防毒免疫请选择3
echo     退出防毒免疫请选择4
:cho
set choice=
set /p choice=    请选择:
if /i "%choice%"=="1" goto start1
if /i "%choice%"=="2" goto start2
if /i "%choice%"=="3" goto start3
:start1
setlocal enabledelayedexpansion
cd /d %systemroot%\temp
if exist tmp.txt del /f /q tmp.txt
if exist disk.txt del /f /q disk.txt
setlocal enabledelayedexpansion
for /f "skip=1 tokens=1,2 delims=\" %%a in ('fsutil fsinfo drives^|find /v ""') do (
    set aa=%%a
    set aa=!aa:~-2!
    for %%i in (!aa!) do fsutil fsinfo drivetype %%i >>tmp.txt
)
set tmp= tmp.txt
find /i "固定驱动器" %tmp% >>disk.txt
for /f "skip=2 tokens=1* delims= " %%i in (disk.txt) do (
md %%i\autorun.inf
md %%i\autorun.inf\hongzhi..\
attrib +R +H +S +A %%i\autorun.inf
echo y|%systemroot%\system32\cacls %%i\AUTORUN.INF /d everyone
)
cls
echo 免疫成功
pause

:start2
setlocal enabledelayedexpansion
cd /d %systemroot%\temp
if exist tmp.txt del /f /q tmp.txt
if exist disk.txt del /f /q disk.txt
setlocal enabledelayedexpansion
for /f "skip=1 tokens=1,2 delims=\" %%a in ('fsutil fsinfo drives^|find /v ""') do (
    set aa=%%a
    set aa=!aa:~-2!
    for %%i in (!aa!) do fsutil fsinfo drivetype %%i >>tmp.txt
)
set tmp= tmp.txt
find /i "可移动驱动器" %tmp% >>disk.txt
for /f "skip=2 tokens=1* delims= " %%i in (disk.txt) (do
md %%i\autorun.inf
md %%i\autorun.inf\hongzhi14..\
attrib +R +H +S +A %%i\autorun.inf
echo y|%systemroot%\system32\cacls %%i\AUTORUN.INF /d everyone
)
cls
echo 免疫成功
pause
:start3
cls
echo         开始自动播放防毒疫苗解除...
echo     注意:在NTFS系统格式下防毒疫苗更安全
echo ==============================================================
echo     解除免疫本地硬盘请选择1
echo     解除免疫移动优盘请选择2
echo     退出解除防毒免疫请选择3
:cho
set choice=
set /p choice=    请选择:
if /i "%choice%"=="1" goto s1
if /i "%choice%"=="2" goto s2
if /i "%choice%"=="2" goto start4
:s1
setlocal enabledelayedexpansion
cd /d %systemroot%\temp
if exist tmp.txt del /f /q tmp.txt
if exist disk.txt del /f /q disk.txt
setlocal enabledelayedexpansion
for /f "skip=1 tokens=1,2 delims=\" %%a in ('fsutil fsinfo drives^|find /v ""') do (
    set aa=%%a
    set aa=!aa:~-2!
    for %%i in (!aa!) do fsutil fsinfo drivetype %%i >>tmp.txt
)
set tmp= tmp.txt
find /i "固定驱动器" %tmp% >>disk.txt
for /f "skip=2 tokens=1* delims= " %%i in (disk.txt) (do
echo y|%systemroot%\system32\cacls %%i\AUTORUN.INF /f everyone:f
attrib -R -H -S -A %%i\autorun.inf
rd /s %%i\autorun.inf\hongzhi14..\
rd /s %%i\autorun.inf
cls
echo 取消免疫成功
pause
:s2
setlocal enabledelayedexpansion
cd /d %systemroot%\temp
if exist tmp.txt del /f /q tmp.txt
if exist disk.txt del /f /q disk.txt
setlocal enabledelayedexpansion
for /f "skip=1 tokens=1,2 delims=\" %%a in ('fsutil fsinfo drives^|find /v ""') do (
    set aa=%%a
    set aa=!aa:~-2!
    for %%i in (!aa!) do fsutil fsinfo drivetype %%i >>tmp.txt
)
set tmp= tmp.txt
find /i "可移动驱动器" %tmp% >>disk.txt
for /f "skip=2 tokens=1* delims= " %%i in (disk.txt) (do
echo y|%systemroot%\system32\cacls %%i\AUTORUN.INF /f everyone:f
attrib -R -H -S -A %%i\autorun.inf
rd /s %%i\autorun.inf\hongzhi14..\
rd /s %%i\autorun.inf
cls
echo 取消免疫成功
pause
:start4
exit