本帖最后由 qixiaobin0715 于 2023-5-17 16:59 编辑
批处理放在源文件夹和目标文件夹同一目录,并保存为ANSI编码:- @echo off&setlocal enabledelayedexpansion
- set "sou=新建文件夹 (9)"
- set "des=新建文件夹 (8)"
- for /f "delims=" %%a in ('dir /ad /b "%des%"') do (
- pushd "%sou%"
- for /f "delims=" %%b in ('dir /a-d /b "%%a-*.jpg"') do (
- if not exist "..\%des%\%%a\%%b" move "%%b" "..\%des%\%%a\"
- )
- popd
- )
- pause
复制代码 刚刚修改了代码 |