level 1
@echo off
set @=q&set/an=0x53b7e0b4
title Any question +%@%%@% %n%
cd /d "%~dp0"
set "需查找的目录=D:\test"
set "未找到文件列表=notfound.log"
cd.>"%未找到文件列表%"
for %%a in (
"文件1.txt|1"
"文件2.jpg|1"
"文件3.xls|4"
) do (
for /f "tokens=1* delims=|" %%b in ("%%~a") do (
set "f="
for /f "delims=" %%e in ('dir /a-d/b/s "%查找的目录%\%%b"') do (
call :loop "%%e" "%%c"
set f=1
)
if not defined f (>>"%未找到文件列表%" echo;%%b)
)
)
echo;Any question +%@%%@% %n%
pause&exit
:loop
if "%~2" equ "0" exit /b
set n=0
set m=0
:check
set /a m+=1
if exist "%~dp1%~n1_%m%%~x1" goto check
copy "%~1" "%~dp1%~n1_%m%%~x1" /y
set /a n+=1
if %n% lss %~2 goto check
exit /b
2019年03月25日 13点03分
