本帖最后由 77七 于 2023-7-6 14:32 编辑
回复 16# feiyan
- @echo off
- rem 站内下载pdftk,修改为实际路径
- set "pdftk=C:\PDFtk\PDFtk\pdftk.exe"
- for /d %%d in (*) do (
- pushd "%%d"
- setlocal enabledelayedexpansion
- for %%a in (S*.pdf) do set "str=!str! "%%a""
- for %%a in ("D C F*.pdf") do set "str=!str! "%%a""
- for %%a in ("D C S*.pdf") do set "str=!str! "%%a""
- for /f "delims=" %%a in ('dir /b /a-d *.pdf ^|findstr /rvb /c:"S" /c:"D C F" /c:"D C S" /c:"D P" /c:"D F"') do (
- set "str=!str! "%%a""
- )
- for %%a in ("D P*.pdf") do set "str=!str! "%%a""
- for %%a in ("D F*.pdf") do set "str=!str! "%%a""
- "%pdftk%" !str! cat output "%%~nxd.pdf"
- move /y "%%~nxd.pdf" ..
- endlocal
- popd
- )
- pause
复制代码
|