@echo off
setlocal enabledelayedexpansion
:: 设置目标目录
set "target_dir=C:\path\to\target\directory"
:: 检查目标目录是否存在,不存在则创建
if not exist "%target_dir%" (
mkdir "%target_dir%"
)
:: 从 filelist.txt 中读取文件路径并复制到目标目录
for /f "tokens=*" %%a in (filelist.txt) do (
echo Copying %%a
copy "%%a" "%target_dir%" /y
if errorlevel 1 (
echo Failed to copy %%a
)
)
echo All files have been copied.
pause
04-13
1981
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-07
4242
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)