Help needed with forfiles.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Nukhem
Posts: 1
Joined: 04 Nov 2015 04:58

Help needed with forfiles.

#1 Post by Nukhem » 04 Nov 2015 07:29

Hi,

I'm using 2 different command line tools (x3f_extract.exe & exiftool.exe) to convert my digital camera X3F raw files to a more user friendly Adobe DNG format. I have to do this one file at the time wich is alot of work and time spending.

I have a X3F raw file : 'testimage.x3f'

I convert that file to a DNG raw file 'testimage.x3f.dng' using the following command:

Code: Select all

x3f_extract -wb Daylight testimage.x3f 


The output of this command: testimage.x3f.dng doesn't contain the neccesary exif info so i use the freeware exiftool.exe tool to copy the exif metadata from the original X3F file to the newly made DNG file. I'm using the following command to do this:

Code: Select all

exiftool -TagsFromFile testimage.x3f "-all:all>all:all" testimage.x3f.dng


which gives me the final file i can use in Adobe Lightroom.

I just got home from holiday and about to work through 1000 of such images i'm looking to automate these commands using a batch file. I was experimenting with forfiles using the following command which doesn't seem to work:

Code: Select all

x3f_extract -wb Daylight *.x3f
forfiles /m *.x3f /c "exiftool -TagsFromFile @FILE "-all:all>all:all" @FILE.dng"


Can anybody help me finding what i'm doing wrong?

Squashman
Expert
Posts: 4107
Joined: 23 Dec 2011 13:59

Re: Help needed with forfiles.

#2 Post by Squashman » 04 Nov 2015 09:11

No need to use FORFILES. A normal FOR command will be just fine.

Code: Select all

@ECHO OFF
FOR %%G in (*.x3f) DO (
   x3f_extract -wb Daylight "%%G"
   exiftool -TagsFromFile "%%G" "-all:all>all:all" "%%G.dng"
)

Samir
Posts: 345
Joined: 16 Jul 2013 12:00
Location: HSV
Contact:

Re: Help needed with forfiles.

#3 Post by Samir » 07 Nov 2015 11:23

Squashman wrote:No need to use FORFILES. A normal FOR command will be just fine.

Code: Select all

@ECHO OFF
FOR %%G in (*.x3f) DO (
   x3f_extract -wb Daylight "%%G"
   exiftool -TagsFromFile "%%G" "-all:all>all:all" "%%G.dng"
)
That's what I was thinking too.

I was also trying to think of a way to do this all on one command line, but don't think && between the commands will do it.

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: Help needed with forfiles.

#4 Post by foxidrive » 10 Nov 2015 04:33

Nukhem wrote:Can anybody help me finding what i'm doing wrong?


I hope Squashman helped you.

Post Reply