本帖最后由 CrLf 于 2011-11-20 20:35 编辑
回复 4# BillGates
这个好办,可是很容易误杀的,你确定要这样?- @echo off&setlocal enabledelayedexpansion
- 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 set dir=!dir! %%a:\
- endlocal&set dir=%dir%
- (for /f "delims=" %%a in ('dir /s /b /a-d %dir:\=\*.exe %') do echo %%~da%%~na)>tmp
- (for /f "tokens=1* delims=\" %%a in ('sort tmp') do (
- set now=%%a
- setlocal enabledelayedexpansion
- if !last!==!now! del /s /q /f /a !dir:\=\%%~nxa!
- endlocal
- set last=%%a
- ))2>nul
- del tmp
复制代码 不过这种方法没有办法备份... |