Can't create ouput file when using -o option and relative path [Solved]
Posted: Sat Mar 02, 2024 5:06 pm
Hi all
As I'm trying to use nconvert within a btach file under windows, I'm facing a problem using relative paths.
Here it is :
Initial directory structure
I just want to resize every file in the whole originals directory structure and put the results in web directory reproducing the directory structure.
So I use this commande line in a batch file :
It looks good but when executing it i face a message
I just copy one line command which is a result like :
Am I missing something ?
Thanks in advance
As I'm trying to use nconvert within a btach file under windows, I'm facing a problem using relative paths.
Here it is :
Initial directory structure
Code: Select all
- originals
- family
- doe
file.jpg
- smith
- friends
- web
So I use this commande line in a batch file :
Code: Select all
for /f %%I in ('forfiles /s /m *.* /c "cmd /c echo @relpath"') do nconvert -ratio -rtype lanczos -rflag decr -rflag orient -resize 1920 1200 %%~I -o "..\web\%%~I"
Code: Select all
Error : Can't open file (-o)
Error : can't open file (..\web\.\family\doe\file.jpg)
Code: Select all
nconvert -ratio -rtype lanczos -rflag decr -rflag orient -resize 1920 1200 .\family\doe\file.jpg -o "..\web\.\family\doe\file.jpg"
Thanks in advance