Code: Select all
cd %~dpnx1
for %%a in (.) do set currentfolder=%%~na
start cmd /k magick "*.{png,jpg,tif}" "%currentfolder%.pdf"
How can I create a function where I can right click on a folder, which searches subfolders and combines the jpgs to PDF?
So in the example below, Im wanting to create 3 PDFS (Folder A, Folder B and Folder C) by right clicking and running batch on the parent folder.
Example:
- Parent folder (one that I would right click and run script from)
|- Folder A
||- test1.jpg
||- test2.jpg
||- test3.jpg
|- Folder B
||- example1.jpg
|| - example2.jpg
|- Folder C
||- temp.jpg
||- temp2.jpg
I have attempted myself with the following, but no luck:
Code: Select all
cd %~dpnx1
for %%a in (.) do set currentfolder=%%~na
FOR /R %%a in (*.jpg) DO (
magick "%%a" "%currentfolder%.pdf"
)