2013-10-12 165 views
-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中合併這些文件後來就打印。

回答

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"