Aqui está um script em lote para fazer o que você precisa.
Você não mencionou o que você quer que aconteça no caso de caminho duplicado \ filename.pdf (de unidades diferentes).
Então, o que eu fiz foi adicionar um número único ao final do nome do arquivo se uma duplicata for encontrada.
Como exemplo disso, se você tiver esses arquivos:
C:\Dir\A.pdf
C:\Dir\B.pdf
C:\Dir\B-1.pdf
C:\Dir\B-2.pdf
C:\Dir\C.pdf
C:\Dir\C-1.pdf
F:\Dir\A.pdf
F:\Dir\B.pdf
F:\Dir\C.pdf
e seu caminho de destino é:
"D:\Test"
o script será copiado:
C:\Dir\A.pdf -> D:\Test\Dir\A.pdf
C:\Dir\B.pdf -> D:\Test\Dir\B.pdf
C:\Dir\B-1.pdf -> D:\Test\Dir\B-1.pdf
C:\Dir\B-2.pdf -> D:\Test\Dir\B-2.pdf
C:\Dir\C.pdf -> D:\Test\Dir\C.pdf
C:\Dir\C-1.pdf -> D:\Test\Dir\C-1.pdf
F:\Dir\A.pdf -> D:\Test\Dir\A-1.pdf
F:\Dir\B.pdf -> D:\Test\Dir\B-3.pdf
F:\Dir\C.pdf -> D:\Test\Dir\C-2.pdf
Inicialmente, o script exibirá apenas os arquivos a serem copiados. Quando tiver certeza de que os arquivos corretos serão copiados para o caminho correto, faça essa alteração no script ...
Encontre esta linha (perto do topo):
set zzlive=0
e altere para:
set zzlive=1
Além disso, você encontrará algumas linhas como:
set zztarget1="C:\*%zzftype%"
set zztarget2="F:\*%zzftype%"
set zztarget3="D:\*%zzftype%"
Adicione quantas destas "Pastas" você precisar ... apenas numere-as sequencialmente.
Quando o script for executado, essas linhas serão "expandidas" para:
set zztarget1="C:\*.pdf"
set zztarget2="F:\*.pdf"
set zztarget3="D:\*.pdf"
Por fim, procure a linha que se parece com:
rem Create .zip
Abaixo dessa linha, adicione seu comando para criar seu arquivo ".zip", mas você quer fazê-lo, dependendo de onde você quer colocar o arquivo ".zip" e outras opções de arquivo ".zip" que você necessita. Se você precisar de ajuda com isso, deixe-me saber alguns detalhes e eu vou ajudá-lo.
Se você precisar de mais informações, ou se precisar que o script funcione de maneira diferente, é só me avisar.
Aqui está o script:
@echo off
rem set "live" (or "test"). 0=test, 1=live
set zzlive=0
rem set "Test" folder
set "zzhold=D:\test"
rem set File type to process
set "zzftype=.pdf"
rem set targets
set zztarget1="C:\*%zzftype%"
set zztarget2="F:\*%zzftype%"
set zztarget3="G:\*%zzftype%"
rem set more targets, up to 10 ...
rem set "Subst" drive. Use *ANY* unused drive letter
set "zzsubst=V:"
rem **********************************
rem probably do not need to edit lines below here
rem just find "rem Create .zip" line and add your zip command there
rem **********************************
rem insure test folder exists
md "%zzhold%">nul 2>&1
rem make Substituted drive so XCOPY won't complain about cyclical copy
if exist "%zzsubst%\*.*" goto :start
subst %zzsubst% "%zzhold%"
if exist "%zzsubst%\*.*" goto :start
echo Error "Subst-ing" drive %zzsubst%
goto :EOF
:start
rem:start
set zztarget=%zztarget1%
for %%e in (%zztarget%) do if "%%~e."=="." goto :done
call :work
set zztarget=%zztarget2%
for %%e in (%zztarget%) do if "%%~e."=="." goto :done
call :work
set zztarget=%zztarget3%
for %%e in (%zztarget%) do if "%%~e."=="." goto :done
call :work
set zztarget=%zztarget4%
for %%e in (%zztarget%) do if "%%~e."=="." goto :done
call :work
set zztarget=%zztarget5%
for %%e in (%zztarget%) do if "%%~e."=="." goto :done
call :work
set zztarget=%zztarget6%
for %%e in (%zztarget%) do if "%%~e."=="." goto :done
call :work
set zztarget=%zztarget7%
for %%e in (%zztarget%) do if "%%~e."=="." goto :done
call :work
set zztarget=%zztarget8%
for %%e in (%zztarget%) do if "%%~e."=="." goto :done
call :work
set zztarget=%zztarget9%
for %%e in (%zztarget%) do if "%%~e."=="." goto :done
call :work
set zztarget=%zztarget10%
for %%e in (%zztarget%) do if "%%~e."=="." goto :done
call :work
goto :done
:work
rem:work
@echo.
if %zzlive% EQU 0 echo Test mode - no files will be copied.
echo.|set /P "zzdummy=Gathering filenames, Please wait... "
set zzstart=0
rem get list of files to copy and pass each filename one to :work1
for /f "usebackq delims=>" %%f in ('xcopy /s /f /l /h %zztarget% "%zzsubst%\"') do call :work1 "%%~f"
@echo.
goto :EOF
:done
rem:done
rem Create .zip
rem put your desired command to create your ".zip" file here.
rem go clear environment vars and exit
goto :cleanup
:work1
rem:work1
if not %zzstart% EQU 0 goto :work1b
@echo Complete - processing files.
@echo.
set zzstart=1
goto :work1b
:work1b
rem:work1b
set "zz1t=%~1"
set "zz1fullfn=%zz1t:~0,-2%"
set zz1t=%zz1fullfn:~-4%
rem @echo [%zz1fullfn%] [%zz1t%]
rem skip lines not containing a valid .pdf filename
if "%zz1t%."=="." goto :EOF
if /I not "%zz1t%"==".pdf" goto :EOF
rem don't process files in "Test" folder
for /f "usebackq delims=" %%g in ('echo set "zz1t=%%zz1fullfn:%zzhold%\=%%"') do %%~g
if "%zz1fullfn%."=="%zz1t%." goto :work2
rem We are trying to process a file in the "Test" folder... skip it.
rem @echo.
rem echo Skipping file: [%zz1fullfn%]
goto :EOF
:work2
rem:work2
rem echo Processing file: [%zz1fullfn%]
for %%g in ("%zz1fullfn%") do call :work3 "%%~dg" "%%~pg" "%%~ng" "%%~xg"
goto :EOF
:work3
rem:work3
set "zz1drive=%~1"
set "zz2path=%~2"
set "zz3file=%~3"
set "zz4ext=%~4"
set "zzsource=%zz1fullfn%"
set "zzdestpath=%zzhold%%zz2path%"
set "zzdestfullfn=%zzdestpath%%zz3file%%zz4ext%"
set "zzxcopydest=%zzdestpath%"
if exist "%zzdestfullfn%" goto :work3fixf
goto :work3copy
:work3copy
rem:work3copy
if %zzlive% EQU 0 goto :work3show
xcopy /h /i /f "%zzsource%" "%zzdestpath%"
@echo.
goto :EOF
:work3show
rem:work3show
xcopy /h /i /f /l "%zzsource%" "%zzdestpath%"|find /i "%zzsource%"
@echo.
goto :EOF
:work3fixf
rem:work3fixf
set zzindex=0
:work3loop
rem:work3loop
set /A zzindex=zzindex+1
set "zzdestfullfn=%zzdestpath%%zz3file%-%zzindex%%zz4ext%"
if not exist "%zzdestfullfn%" goto :work3rencopy
rem if you want to set a "Maximum" for number of dups to check, test "%zzindex%" here
goto :work3loop
:work3rencopy
rem:work3rencopy
if %zzlive% EQU 0 goto :work3renshow
md "%zzdestpath%">nul 2>&1
copy /y nul "%zzdestfullfn%">nul 2>&1
xcopy /h /i /f /y "%zzsource%" "%zzdestfullfn%"
@echo.
goto :EOF
:work3renshow
rem:work3renshow
echo xcopy /h /i /f /y %zzsource% -^> %zzdestfullfn% (ren)
@echo.
goto :EOF
:cleanup
rem:cleanup
subst %zzsubst% /d>nul 2>&1
set "zz1drive="
set "zz1fullfn="
set "zz1t="
set "zz2path="
set "zz3file="
set "zz4ext="
set "zzdestfullfn="
set "zzdestpath="
set "zzftype="
set "zzhold="
set "zzindex="
set "zzlive="
set "zzsource="
set "zzstart="
set "zzsubst="
set "zztarget="
set "zzxcopydest="
goto :EOF
rem mkdir d:\test
rem mkdir f:\test1
rem chcp 65001
rem XCOPY C:*.pdf D:test /S /H
rem XCOPY F:*.pdf D:test /S /H
rem XCOPY D:*.pdf F:test1 /S /H
rem copy f:\test1 d:\test\kra\