[Originally posted by abramley on 2009-11-06 00:47:59-08]Hi all,
I ran Win Vista 32bit with Exiftool and active perl very happily for a while to add the Lens ID to the XMP of my Minolta and Sony shots. I now have a win 7 64bit desktop and unfortunately, despite copying everything from my old machine, I cannot get it to alter the files. When I ask the bat file to run, it simply gives me the basic console of exiftool with all the help documentation. You can find a screenshot here:
http://farm4.static.flickr.com/3575/4078679867_cd693369e7_o.jpgIn the example above I dragged the .arw onto the correct .bat.
My .bat reads as follows:
@echo off
:begin
if _%1_==__ goto end
echo Processing %1...
C:\exiftool\exiftool.pl -k -TagsFromFile %%d%%f.arw "-lensId>lens" -overwrite_original -ext XMP %1 -r
shift
goto begin
:end
Which is identical to the version that worked on my old machine, the only change being the path to exiftool.pl.
Any help will be much appreciated! When replying please bear in mind the fact that I'm a 100% newbie - the above .bat was written for me and I was hand-held through the entire process the first time around. I know how to use a computer, but nothing at all about perl, so please be gently!
Best regards,
Adam
[Originally posted by exiftool on 2009-11-06 12:07:27-08]Hi adam,
ExifTool will print the help if no image file names are given
on the command line. I think this must be the problem. Likely
somehow the %1 is not working for you. I suggest putting
and "echo" command before the exiftool line to see exactly
what command you are attempting to execute, and comparing
this with your old system.
echo C:\exiftool\exiftool.pl -k -TagsFromFile %%d%%f.arw "-lensId>lens" -overwrite_original -ext XMP %1 -r
- Phil
[Originally posted by abramley on 2009-11-06 13:12:06-08]Hi Phil,
Thanks for that response. Here is the result of putting an echo where you suggested in the .bat file:
http://farm4.static.flickr.com/3631/4080563124_59e7c186b3_o.jpgAll I can confirm is that the file path is correct - I'm afraid I have no skill in perl at all. I can follow an instruction, but that's it...
When running that time the information was still not copied.
I attempted to compare this with my old machine but the cmd line disappears without ever displaying text so I am unable to capture what happens with a screenshot. How do I make the cmd window remain on my screen?
Thanks again for your help,
Adam
[Originally posted by exiftool on 2009-11-06 13:37:25-08]
Hi Adam,
Sorry, I totally missed the fact that you are writing an ARW image.
ExifTool currently doesn't support writing ARW (I hope to add this
support but haven't yet implemented ARW writing).
For these images you are stuck writing an XMP sidecar file for now.
BTW, You can make the batch file pause with a "pause" command
I think (to avoid the window disappearing).
- Phil
[Originally posted by abramley on 2009-11-06 13:54:04-08]
Hi Phil, my mistake - the bat works on the XMP sidecar, not the RAW itself. Exiftool should read the tag from the ARW and write it to the XMP sidecar - this is how the bat file worked on my Vista machine. It still works just fine there, and my current workflow is actually to generate the XMPs on my laptop and port them over to my Win7 desktop - obviously very unwieldy.
I'm afraid I'm simply way over my head here - everything seems to be fine but nothing is working. Exiftool detects the file, is told to read the LensID tag from the ARW and write it to the XMP. Except it doesn't :E Running the command with pause on my vista laptop shows no differences at at all - the only difference being that it does write the correct Lens ID to the exif.
Thanks again for your help
[Originally posted by exiftool on 2009-11-06 13:59:41-08]
OK, then I think the problem is that you are running the batch file
on the ARW image instead of the XMP sidecar.
Alternatively, it should work if you run the batch file on a folder
of images with sidecar files.
- Phil
[Originally posted by abramley on 2009-11-06 14:16:21-08]I'm afraid I've still not managed to make it work - I've tried running the batch on the XMPs and on the folder containing RAWs and XMPs.
Here's what happens when I run the batch on my Vista machine:
www.jaggerbramley.com/good.xmpThe basic information such as the location, copyright etc was added to the XMP created upon import. The batch file adds the aux:LensCarl Zeiss Vario-Sonnar T* 24-70mm F2.8 ZA SSM (SAL-2470Z)/aux:Lens line.
A file run through the exact same process on my Win 7 machine comes up with the following:
www.jaggerbramley.com/bad.xmpAs you can see, the Lens string is absent - exiftool simply hasn't done its job. Why I just can't answer!
Cheers, Adam
[Originally posted by exiftool on 2009-11-06 14:33:15-08]
Hi Adam,
You're right, it's not working. I'm sure we can solve this,
but it may take a few iterations.
Try adding a -v option to the command in the .bat file,
then run it on your Windows 7 machine and show me the
result. (I'm assuming you took out the "echo" from before,
right?).
- Phil
[Originally posted by abramley on 2009-11-06 14:53:32-08]Hi Phil,
Many thanks for your patience! The latest version of the batch file reads like this:
@echo off
:begin
if _%1_==__ goto end
echo Processing %1...
C:\exiftool\exiftool.pl -k -TagsFromFile %%d%%f.arw "-lensId>lens" -overwrite_original -ext xmp %1 -r -v
pause
shift
goto begin
:end
I ran this on both the ARW and the XMP and neither was succesful - both ran exiftool and gave me the help option.
Cheers, Adam
[Originally posted by exiftool on 2009-11-06 15:19:23-08]OK, so we're back to exiftool not getting the file name, which
is where we started.

But I saw from your "echo" output that you were indeed passing
a filename to exiftool (with %1), but it was an arw file, which
was wrong.
How exactly are you running the .bat file? Are you dropping
an image onto the icon of the .bat file? This should work.
Try changing the exiftool command to this and see what happens:
C:\exiftool\exiftool.pl -k -echo "test1" -echo %1 -echo "test2"
This should print out three lines in the window, "test1" and "test2"
(without quotes) and the full path name of the file in between
(again, without quotes).
Is this what happens?
- Phil
[Originally posted by abramley on 2009-11-06 16:51:37-08]I think we're getting somewhere now - I didn't get the expected result when I changed the code to that above. My bat was as follows:
@echo off
:begin
if _%1_==__ goto end
echo Processing %1...
C:\exiftool\exiftool.pl -k -echo "test1" -echo %1 -echo "test2"
pause
shift
goto begin
:end
and once more exiftool ran with the help interface. I usually run Exiftool through a custom button which launches the bat file externally, but during this testing I've been trying to run it by dragging both the XMP and the RAW, as well as the whole folder onto the bat.
I think that at this stage it would be useful to give you a real overview of what I'm doing - I wrote a post a while ago to explain my method to others:
http://www.dyxum.com/dforum/walkthrough-to-adding-lens-ids-in-lightroom_topic39797.html?KW=and I have also shared my troubles on the same forum where a couple of other users have described running Win7 64bit and not having any problems:
http://www.dyxum.com/dforum/topic54702&get=last.html#602023I look forwards to your response! Adam
[Originally posted by exiftool on 2009-11-06 18:12:57-08]
Ok. The only way I can see you getting the help text with the above
code is if you are using a REALLY old version of exiftool. What
version are you using (run "exiftool -ver")?
The current version is 7.99.
- Phil
[Originally posted by abramley on 2009-11-06 19:12:16-08]Sorry - newbieness coming out here.
How would I run exiftool with -ver? I created a bat file which was simply:
c:\exiftool\exiftool.pl -ver
pause
But this also gave me the help screen. Unless exiftool is royally screwed on my machine...
[Originally posted by exiftool on 2009-11-06 22:35:22-08]
So exiftool just isn't getting any of the options you pass.
Something fundamental is wrong here.
It is interesting to me that you are running the Perl version
of exiftool (exiftool.pl) instead of the Windows executable
version (exiftool.exe). For this to work, you must have
installed Perl, which I find surprising because this is not
the usual thing to do. Let's take a step back. Tell me
exactly how you installed exiftool.
Also, it would be useful if you learned how to run
exiftool from the command line. To open a command
window in XP, you select "Run..." from the "Start" menu
then type "cmd". Hopefully in Windows 7 something
similar to this works too.
- Phil
[Originally posted by abramley on 2009-11-07 00:28:32-08]Last post for the night - I need some sleep!
I'm running the perl version of exiftool because I believe that only using the perl version do you get access to the /lib/Image/Exiftool/Minolta.pm file - I've edited this to reflect the lenses that I use. Do I get access to this file using the .exe? If that's the case and it would be simpler to go with that than to fuss around with perl then I'm more than willing!
To install exiftool, I followed the instructions here:
http://www.exiftool.org/install.html. I installed the 64bit version of activeperl from here:
https://www.activestate.com/activeperl/downloads/ choosing the 64bit windows version. This is the only change that I've made from my 32bit vista install - although I have to admit that I installed everything so long ago that I can't remember my exact steps back then.
I'm good to go with the command line - I couldn't get it to work before because I'd not set the associations (or they didn't work in the DOS environment) so I wasn't typing perl exiftool.pl -ver. That all works now and I'm actually still on v7.56 - will update that now...
[Originally posted by abramley on 2009-11-07 00:39:32-08]
Ok - bed now.
I've updated to v 7.99 and I've not noticed any difference. Dragging XMLs onto the batch still results in Exiftool running the help line - the only difference being that because I've not authed the new version to run as admin it now asks me if I want to do so. Thanks for your persistance - I'll be back in the morning! Adam
[Originally posted by exiftool on 2009-11-07 11:22:46-08]Hi Adam,
I hope you had a good sleep. I did.

Please let me know if you have any lenses that exiftool does not
yet support and I will add them to the list. Otherwise, if there are
ambiguous lenses and you are just tuning exiftool to select the
proper lens, you can do this with any version of exiftool by adding
user-defined lenses to the config file. See the
sample
config file for details. The user-defined lens example is
near the bottom of the page. This feature was added in version
7.50, so it would have also worked with your old exiftool.
If the user-defined lenses don't do exactly what you want, you can
may still be able to play with Minolta.pm with the Windows exe version.
When you run the exe version for the first time it unpacks the Perl
source code into your temporary directory and runs it from there.
So you should be able to just edit Minolta.pm in the temporary
directory. With a normal XP system the temporary directory is
"C:\Documents and Settings\USER\Temp\par-USER", but I don't know where
it would be in Windows 7. (If you find out, please let me know.)
I think trying the Windows executable would be a good idea
because that should eliminate any potential problems with the Perl
installation.
- Phil
[Originally posted by bogdan on 2009-11-07 12:24:42-08]
Hi,
Just jumping here-in (for where's Exiftool's temp files on Win7 64-bit)... It's inside:
c:\Users\YourName\AppData\Local\Temp\par-YourName
Sidenote: From my expirience, Exiftool (Win-executable) works on Win7 64-bit as expected.
Greetings,
Bogdan
[Originally posted by wyant on 2009-11-07 14:08:21-08]Yes, this is an interruption to the way this troubleshooting session is going, but:
When you are running the Perl file, are you doing
perl c:\exiftool\exiftool.pl
?
Or are you just doing
c:\exiftool\exiftool.pl
, and letting the file type association figure out to run Perl? In the latter case, you do not get at least some features of the shell -- redirection for sure, and maybe command line arguments as well. At least, this is true under XP. I haven't touched Windows since Vista came out, so can't tell about more recent versions, but this was a "feature" of earlier versions of Windows.
So if at some point it seems desirable to run exiftool.pl rather than exiftool.exe, this might be a thing to try.
[Originally posted by abramley on 2009-11-07 14:58:48-08]Hi!
I've cleared my machine of perl and the perl version of exiftool and I've replaced everything with the latest .exe. When I drag an XMP onto the .exe it correctly displays the exif of the file. I now need help making the exe do what I want it to!
I've started off by simply replacing the reference to exiftool.pl with exiftool.exe in my bat file - I get the error that 'C:\exiftool\exiftool is not recognised as a valid executable or batch file'. Is the error because the .exe is not being picked up for some reason? My batch reads like so:
@echo off
:begin
if _%1_==__ goto end
echo Processing %1...
C:\exiftool\exiftool(-k).exe -TagsFromFile %%d%%f.arw "-lensId>lens" -ext XMP %1 -overwrite_original -r
pause
shift
goto begin
:end
I have replaced the temp minolta.pm with my custom version - however if this is going to be deleted every time windows decides to clear its temp files then maybe I'll look into the custom file. Look forwards to getting this one working - thanks again for your continued support!
[Originally posted by exiftool on 2009-11-07 18:00:14-08]Thanks Bogdan,
I suggest renaming the executable to "exiftool.exe". The
"(-k)" in the name is for the drag-n-drop feature and
just confuses things when running from the command line.
Once renamed (and in the c:\exiftool\ directory), this
should work with:
@echo off
:begin
if _%1_==__ goto end
echo Processing %1...
C:\exiftool\exiftool -TagsFromFile %%d%%f.arw "-lensId>lens" -ext XMP %1 -overwrite_original -r
pause
shift
goto begin
:end
(fingers crossed).
If this doesn't work, then I think we have narrowed it down to a problem
with the batch file.
- Phil
[Originally posted by abramley on 2009-11-07 22:50:10-08]
Fantastic - that seems to have worked! I'll keep on testing and I'll be back if I discover anything that's not working. Thanks very much for helping me with this Phil, and thanks also for writing such a great little program - there's a fair few Sony/Minolta users who appreciate your work. Enjoy your weekend! Adam
[Originally posted by exiftool on 2009-11-08 11:16:00-08]Excellent!!
Now that we have it working I will make a suggestion.
Your batch file can be simplified and made more efficient
by processing all images with a single call to exiftool:
@echo off
C:\exiftool\exiftool -TagsFromFile %%d%%f.arw "-lensId>lens" -ext XMP %* -overwrite_original -r
pause
The "%*" represents all arguments passed to the batch file,
instead of processing them one at a time with "%1" and "shift".
- Phil
[Originally posted by abramley on 2009-11-09 14:53:18-08]
Great stuff - that little update also works fine - just had to put .exe on the end of the path.
Thanks once more for your help - I'll pass my experience onto the folks at Dyxum too. Even after Adobe supported abbreviated lens IDs in LR 2.5, many people still seem to be using exiftool.