-ext produces / on windows

Started by Bona Sierra, July 16, 2024, 03:22:45 PM

Previous topic - Next topic

Bona Sierra

Hi all,

when using "-filepath -ext extension" with the -p command, the path output is with "/" instead of "\" on windows systems, so I have to apply a string substitution as workaround.
e.g. exiftool -m -p "$filepath"  -ext JPG .
output: H:/IMG/Original/20180630_220548_944.JPG


Using file extension w/ or w/o wildcard always outputs "/" instead.
e.g. exiftool -m -p "$filepath" 20180630*.jpg
output: H:\IMG\Original\20180630_220548_944.JPG

Exiftool should always use the system delimiter character for directory names.

Exiftool version is 12.87
Terminal window on Windows 11 Pro Build 22621
Windows 11 Pro

Phil Harvey

Sorry, but ExifTool has used forward slashes for the last 20 years without a request like this, and changing it now would break things for a lot of people.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

You can always code the substitution directory in the -p (-printFormat) FMT string

exiftool -m -p "${Filepath;s(/)(\\)g}" -ext JPG .
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Bona Sierra

OK, thanks. I will then apply the workaround with the substitution.
Windows 11 Pro