ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Birdman on February 23, 2023, 03:19:01 PM

Title: How to address the current directory?
Post by: Birdman on February 23, 2023, 03:19:01 PM
Hello there,

I would like to run a Windows-CMD-file containing an exiftool command from a directory which has no files, but several subdirectories. I used the *.jpg -r command in order to carry out the command for every jpg-file in every subdirectory. But since there is no jpg-file in the current directory (where the cmd starts) the command will stop immediately. Putting the current/parent directory in the command will not work, since I would like to use the cmd in different directories by just coping it and starting there.
Title: Re: How to address the current directory?
Post by: Phil Harvey on February 23, 2023, 03:21:33 PM
Hi Martin,

Try this:

exiftool -ext JPG -r DIR

where DIR is "." for the current directory, or the path to any other directory.

- Phil
Title: Re: How to address the current directory?
Post by: Birdman on February 23, 2023, 03:30:15 PM
Thank you, that worked perfectly!
Title: Re: How to address the current directory?
Post by: StarGeek on February 23, 2023, 03:31:52 PM
To create a drag/drop bat file, you could use
exiftool -ext JPG -r %*

Relevant links as to why you can't use *.jpg and recurse
Common Mistake #2 (https://exiftool.org/mistakes.html#M2)
-r (-recurse) option (https://exiftool.org/exiftool_pod.html#r-.--recurse)