- @echo off
- rem 保存为ansi
- cd /d "%~dp0"
- set file=d:\1.txt
-
- for /f "delims=" %%i in ('dir /b /a-d *.txt') do (
- call :1 "%%i"
- )
- pause
- exit
-
- :1
- for /f "useback delims=" %%a in ("%file%") do (
- find "%%a" "%~1" 1>nul
- if not errorlevel 1 (
- del "%~1"
- echo find "%%a" del "%~1"
- exit /b
- )
- )
- exit /b
复制代码
|