- @echo off
- Setlocal enabledelayedexpansion
- ::CODER BY Administrator POWERD BY iBAT
- ::设置pdf所在的上级目录 pdfimages.exe放置于该目录
- set filedir=C:\test
- cd /d %filedir%
- for /f "delims=" %%i in ('dir /ad /b %filedir%') do (
- for /f "delims=" %%j in ('dir /s/b %%i\*.pdf') do (
- %filedir%\pdfimages.exe %%j -j %%~dnpj.jpg
- del %%j
- )
- )
- for /f "delims=" %%i in ('dir /s /b %filedir%\*.jpg') do (
- set filename=%%i
- set filename1=%%~ni
- ren !filename! !filename1:~0,-4!
- )
- pause
复制代码
|