- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=_ tokens=1" %%i in ('dir /b d:\1\*.jpg') do (
- echo %%i>>d:\1.txt
- )
- for /f "delims=" %%a in ('dir /b d:\2\*.jpg') do (
- echo %%~na>>d:\2.txt
- )
- for /f "delims=" %%b in ('type d:\2.txt') do (
- find "%%b" d:\1.txt || del "d:\2\%%b.jpg"
- )
- del d:\1.txt
- del d:\2.txt
- pause
复制代码 根据自己的情况进行修改吧 |