CODE: [Copy to clipboard]
@echo off
setlocal enabledelayedexpansion
:main
title Anti-virus V1.03(cn)
echo Anti-virus Version 1.03
set b=.exe
echo.
echo.此批处理用于查找缓存 个人文档 应用文档 公共文档中的可执行程序
:main
set a=0
set c=0
for /f "tokens=2 delims==" %%i in ('set^|findstr "TEMP ALLUSERSPROFILE APPDATA USERPROFILE"') do (
for /f "tokens=1-4 delims= " %%a in ('dir /s "%%i"^|find /I "%b%"') do (
set /a a+=1
set rep!a!=%%i
set name!a!=%%d
echo [!a!] %%d %%a %%b)
)
echo.
echo ^<==注意==^> 总共"%b%"文件为: %a% 个
echo.
if "%a%"=="0" cls&echo 指定文件夹中不存在%b%文件&pause>nul&cls&goto main
set /p c="更多信息请输入"[]"内的数字:"
for /f "tokens=*" %%i in ('dir "!rep%c%!" /s /b /a^|find /I "!name%c%!"') do (
del /P "%%i"
)
set /p d="是否继续操作?(Y/N):"
if /i "%d%"=="Y" cls&goto main else (exit)