I’m currently facing the problem that I need process files in every sub-directory, I’m using a for loop like this one:
for /R %%x in (*.dat) do tool.exe -c -f -e "%%x"
Now it does process everything but the tool outputs a file and that file always lands in the directory where the batch script got launched in and not in the directory where the original file was located.
I tried a quite a few approaches like using %CD% as the output directory option for the tool but it looks like the tool didn’t like that very much and just gave errors.
I’m looking for a general solution as I had this problem with quite a few CLI tools now.
You could
CDto the directory where the current.datlies before callingtool.exe: