Monday, 9 September 2013

How to execute two commands in one for loop of .bat?

How to execute two commands in one for loop of .bat?

I have written a short .bat file that converts images via a few programs
that I have. Unfortunately, the folders of images that I have are very
large, and as it stands now, this program makes a .png, but also leaves a
.pgm. This causes the program to stop because the folder runs out of
memory.
the .bat now is:
mogrify -format pgm ephemeral:*.png
forfiles /M *.pgm /C "cmd /c for %%s in (@fname) do DebayerGPU.exe
-demosaic DFPD_R -GPU -pattern GRBG -i %%s.pgm -o %%s.ppm"
mogrify -format png ephemeral:*.ppm
I have tried adding "del @fname.pgm" in its own quotes, and I have tried
putting () around the command after the do statement, putting a ; and
adding del @fname.pgm. But that also doesn't work.
The second line of the program converts a .pgm to a .ppm and leaves the
.pgm there. My goal is to add another command/line that deletes the .pgm
after it is converted to a .ppm.
Thanks for any help you guys can offer!

No comments:

Post a Comment