I have this batch:
for /f %%a IN ('dir /b *.pdf') do call convert.exe %%a
This gets every pdf file thats in the same folder as convert.exe. I want to be able to say where the PDF resides. What do I have to change?
Thanks!
To loop through a directory, and then print the name of the file, execute the following command: for FILE in *; do echo $FILE; done.
Try using the conditional execution & or the && between each command either with a copy and paste into the cmd.exe window or in a batch file. Additionally, you can use the double pipe || symbols instead to only run the next command if the previous command failed.
If the directory name can be hardcoded, then it will be
for /f %%a IN ('dir /b /s "Disk:\Your\Directory\Name\*.pdf"') do call convert.exe %%a
Note that this will also return all .pdf files in subdirectories of Disk:\Your\Directory\Name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With