回复 9# crestcn - @echo off & cd /d "%~dp0"
- setlocal enabledelayedexpansion
- set "files="文件名1.mp4^|C:\文件夹1" "文件名2.mp4^|C:\文件夹2" "文件名3.mp4^|C:\文件夹3""
- for /r %%i in (*) do (
- for %%a in (!files!) do (
- for /f "tokens=1* delims=|" %%b in ("%%~a") do (
- if "%%b"=="%%~nxi" (
- echo 找到%%b
- mkdir "%%c" >nul 2>nul
- echo copy "%%i" "%%c\"
- set "files=!files:%%a=!"
- if "!files: =!"=="" set "files=NULL" & goto :done
- echo -------------------
- )
- )
- )
- )
- :done
- echo.
- echo 查找完成!
- echo 未找到数据: %files%
- echo.
- pause&exit
复制代码
|