发布网友 发布时间:2022-04-23 04:02
共1个回答
热心网友 时间:2023-06-21 01:59
灞曞紑鍏ㄩ儴@echo off
set "file_name=FM"
set "DstDir=d:\test\鎸囧畾鏂囦欢澶?quot;
if not exist "%DstDir%" md "%DstDir%"
for /r %%a in ("*%file_name%*") do (
set "_path=%%~dpa"
setlocal enabledelayedexpansion
if /i "!_path:%DstDir%=!" equ "!_path!" (
set "_path=!_path:%~dp0=!"
set "_path=!_path:\=-!"
echo;f|xcopy "%%a" "%DstDir%\!_path!%%~nxa" /y
)
endlocal
)
pause