I have a pair of .bat files set up to modify and convert multiple .tif images in a single directory.
It's not working right. I also need to set it up to run in multiple subdirectories. (It's a large-scale image conversion I'm working on)
The first .bat file simply executes a for command:
Code:
for %%f in (*.tif) do call echo.bat %%f
The second .bat file takes that parameter, and does this:
Which should set the variable 'file' to the file's name without file extension. It then runs through a series of commands to convert the file type, set the background to transparent, and cleans up the image.
It's working well, except for a couple of things:
on Angel.tif, and Bee.tif it works fine... but then it hits Bird House.tif and the space messes up the string parser, and it ends up returning just 'Bird' instead of 'Bird House'
How do I get the spaces to stay in there?
The "set file=%file:~0,-4%" doesn't work either, because that gets messed up by the space as well.
Also, I need this .bat to function not just in the directory it's put in, but instead I need to modify it somehow to run in each of the subdirectories 2-4 folders deeper than the current directory, and do the same thing to the files in those subdirectories. And... some of the folders have white space in their names too. Does anyone know how to make this all work?