假定按名称排列- @Echo off&SetLocal EnableDelayedExpansion&set n=0
- for /r %%i in (*)do (
- if not "%%~nxi"=="%~nx0" (set /a n+=1
- if "!n!"=="1" set L=%%i
- set J=%%i
- )
- )
- for /r %%i in (*)do if not "%%~nxi"=="%~nx0" if not "%%i"=="!L!" if not "%%i"=="!J!" del/s/q "%%i"
- pause
复制代码
|