-1

我有一个来自不同文件夹的 pdf 文件链接列表。有没有办法使用批处理文件将这些文件复制到另一个文件夹并保留重复文件?下面的例子。

C:\my folder\file1.pdf
C:\my folder\file2.pdf
C:\my folder\file3.pdf
C:\my 2nd folder\file3.pdf
C:\my 3rd folder\file2.pdf

C:\backup\file1.pdf
C:\backup\file2.pdf
C:\backup\file2(1).pdf
C:\backup\file3.pdf
C:\backup\file3(1).pdf

我需要在 Acrobat 中合并这些文件并稍后打印。

4

1 回答 1

1
@echo off
for %%a in (
"C:\my folder\file1.pdf"
"C:\my folder\file2.pdf"
"C:\my folder\file3.pdf"
"C:\my 2nd folder\file3.pdf"
"C:\my 3rd folder\file2.pdf"
) do for %%b in ("%%~dpa\.") do copy "%%~a" "c:\backup\%%~nxb-%%~nxa"
pause

上面的代码将创建这样的复制命令,如果这适用于您的情况:

copy "C:\my folder\file1.pdf" "c:\backup\my folder-file1.pdf"
copy "C:\my folder\file2.pdf" "c:\backup\my folder-file2.pdf"
copy "C:\my folder\file3.pdf" "c:\backup\my folder-file3.pdf"
copy "C:\my 2nd folder\file3.pdf" "c:\backup\my 2nd folder-file3.pdf"
copy "C:\my 3rd folder\file2.pdf" "c:\backup\my 3rd folder-file2.pdf"
于 2013-10-12T08:14:38.297 回答