I want to loop through a folder and its subfolders, get all .jpg
files and run myapp.exe
on the files where I rename the currently found file's extension. myapp.exe
takes the full file path as input and a renamed file as output, like so:
myapp.exe C:\images\original\210_551_210-768--RJF3823klzw.jpg -o C:\images\original\210_551_210-768--RJF3823klzw.gif
I now have this to recursively print the full path of *.jpg
files.
for /f "delims=" %%i in ('dir /a-d/b/s *.jpg') do echo "%%i" "%%~ni.gif"
However, this prints only the filename for the second parameter, whereas I want to include the path of the found file.
How can I include the path of the output file, the second parameter for myapp.exe
?
Pseudocode:
for /f "delims=" %%i in ('dir /a-d/b/s *.jpg') do myapp.exe "%%i" "<FULLPATH><FILNAME>.gif"