...一个批处理程序清除U盘里的病毒,同时去掉所有文件夹的隐藏、系统属性...
发布网友
发布时间:2024-10-21 07:29
我来回答
共3个回答
热心网友
时间:2024-11-14 12:41
@echo off & color e
for /f "tokens=* delims=驱动器: " %%i in ('fsutil fsinfo drives^|more') do (
echo.
echo 正在检测 %%i 盘,请稍候……
for /f "delims= " %%j in ('fsutil fsinfo drivetype %%i^|find "可移动驱动器"') do (
set "mark=mark"
echo 发现可移动磁盘 %%j
call :checkVBS %%j
call :checkExe %%j
call :autorunAmmu %%j
call :showHiddenFiles %%j
)
)
echo.&echo.
if not defined mark (echo 未发现可移动磁盘,按任意键退出!) else (
echo 所有操作结束,按任意键退出!
)
echo.
echo ------------------------------
echo Code By JHQ
echo 2010-07-30
echo ------------------------------
pause>nul
exit
:checkVBS
echo.
echo ---------------------------------------------------
echo 1.正在检测 %1 中是否存在VBS脚本文件,请稍候……
for %%i in (%1*.vbs) do (
echo 您的移动设备根目录存在VBS脚本文件!
echo 正在更改VBS文件扩展名以阻止其运行……
attrib -h -s -r %1*.vbs>nul 2>nul
ren %1*.vbs *.vbs.del>nul 2>nul
)
goto :eof
:checkExe
echo.
echo ---------------------------------------------------
echo 2.正在检测 %1 中是否存在exe可执行文件,请稍候……
for %%i in (%1*.exe) do (
echo %1 盘根目录检测到exe文件 "%%i",是否删除?y/n
set /p cho=
if not defined cho del /f /q "%%i"
if /i "cho" equ "y" del /f /q "%%i"
)
goto :eof
:autorunAmmu
echo.
echo ---------------------------------------------------
echo 3.正在创建 autorun.inf 免疫文件夹,请稍候……
attrib -h -s -r %1autorun.inf>nul 2>nul
rd /s /q %1autorun.inf>nul 2>nul
del /q /f %1autorun.inf>nul 2>nul
md %1autorun.inf
md %1autorun.inf\nokill..\
attrib +h +s +r %1autorun.inf>nul 2>nul
goto :eof
:showHiddenFiles
echo.
echo ---------------------------------------------------
echo 4.正在去除磁盘根目录隐藏文件夹隐藏属性,请稍候……
attrib -h /d /s %1*>nul 2>nul
goto :eof
热心网友
时间:2024-11-14 12:44
@echo off
set /p u=请输入U盘盘符:
%u%:
attrib -s -h
for /d %%i in (*) do echo %%i >> dir
FOR /F "eol= tokens=1 delims=" %%a in (dir) do echo attrib -s -h -r "%%a.exe" >> att.bat
echo attrib -s -h -r Recycled.exe >> att.bat
echo attrib -s -h -r autorun.inf >> att.bat
FOR /F "eol= tokens=1 delims=" %%a in (dir) do echo del "%%a.exe" >> del.bat
echo del Recycled.exe >>del.bat
echo del autorun.inf >>del.bat
call att.bat
call del.bat
del att.bat
del del.bat
del dir
taskkill /f /im XP-BA571DA3.EXE
set ic=%USERNAME%
del "%SystemDrive%Documents and Settings\%ic%「开始」菜单程序启动 .lnk"
attrib -s -h -r "%windir%system32XP-BA571DA3.EXE"
del "%windir%system32XP-BA571DA3.EXE"
pause
热心网友
时间:2024-11-14 12:39
(reg Query HKCU\Software\Microsoft\Windows\Currentversion\Explorer\Advanced /v Hidden|findstr "2">nul&&goto s1)||goto s2
:s1
reg add HKCU\Software\Microsoft\Windows\Currentversion\Explorer\Advanced /v Hidden /t REG_DWORD /d 1 /f
exit
:s2
reg add HKCU\Software\Microsoft\Windows\Currentversion\Explorer\Advanced /v Hidden /t REG_DWORD /d 2 /f
exit