Here is a batch script to do what you need.
You didn't mention what you want to happen in case of duplicate path\filename.pdf (from different drives).
So, what I did was to add a unique number to the end of the filename if a duplicate is found.
As an example of this, if you have these files:
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
and your target path is:
"D:\Test"
then the script will copy:
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
Initially, the script will only display the files to be copied. Once you are confident the correct files will be copied to the correct path, make this change to the script...
Find this line (near the top):
set zzlive=0
and change it to:
set zzlive=1
Also, you will find some lines like:
set zztarget1="C:\*%zzftype%"
set zztarget2="F:\*%zzftype%"
set zztarget3="D:\*%zzftype%"
Add as many of these "Folders" as you need... just number them sequentially.
When the script runs, these lines will "expand" to:
set zztarget1="C:\*.pdf"
set zztarget2="F:\*.pdf"
set zztarget3="D:\*.pdf"
Finally, look for the line that looks like:
rem Create .zip
Below that line, add your command to create your ".zip" file however you want to do it, depending on where you want to put the ".zip" file and other ".zip" file options you require. If you need help with this, just let me know some details and I will help you.
If you need more information, or if you need the script to work differently, just let me know.
Here is the 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\
PDF
files in a specific directory on each drive? Or are they throughout the drive?