Following Windows batch command converts all tif images in the folder C:\\RootFolder\\Folder1.
for %%i in (C:\RootFolder\Folder1\*.tif) do "Tiff2Pdf.exe" -o C:\RootFolder\Folder1\%%~ni.pdf %%i
How can I do it for all the folders available in RootFolder?
RootFolder
-Folder1
-Folder2
-Folder3
.
.
Thanks for your time
There's another way - just to add it:
@echo off
for /r "c:\rootfolder\folder1" %%a in (*.tif) do "Tiff2Pdf.exe" -o "%%~dpna.pdf" "%%a"
I also changed the loop variable to a
because i is close to l and I and 1 in many fonts.
FOR /F "delims=" %%i IN ('dir /b /s C:\RootFolder\Folder1\*.tif') DO "Tiff2Pdf.exe" -o "%%~dpi%%~ni.pdf" "%%i"
dir /s /b
to do a full recursive enumeration FOR /F "delims="
to parse the results and handle paths with spaces.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.