Exiftool Command from ButtonBar

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
fidofido300
Junior Member
Junior Member
Posts: 28
Joined: 2003-07-28, 16:55 UTC

Exiftool Command from ButtonBar

Post by *fidofido300 »

Hi
I am trying to run following command from Button bar but I could not succeed formatting it to run.

exiftool -ext '*' '-FileName<%f.$FileTypeExtension' -r ../images

../images is the variable part

Thanks in advance
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Exiftool Command from ButtonBar

Post by *Stefan2 »

Maybe use full path with quotes to the exiftool exe.


What is that command supposed to do?
Can you explain us the single parts of that command.



 
User avatar
fidofido300
Junior Member
Junior Member
Posts: 28
Joined: 2003-07-28, 16:55 UTC

Re: Exiftool Command from ButtonBar

Post by *fidofido300 »

Change the file extension of all files under ../images folder according to their MIME type recursively.

-ext extention of file
'*' : all Files
'-Filename<%f.FileTypeExtension' Change filename extension
-r recursively
../images %P in Total Commander
User avatar
Dalai
Power Member
Power Member
Posts: 9949
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Exiftool Command from ButtonBar

Post by *Dalai »

Is %f an ExifTool parameter? If so, double the percent signs because %f is also a TC placeholder. Press F1 when editing a button to see all other placeholders.

Generally it's a good idea to add a question mark at the start of the parameters field when a button doesn't seem to work properly. This makes TC show a confirmation dialog with all own placeholders already replaced (before the command is actually executed).
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Exiftool Command from ButtonBar

Post by *Stefan2 »

Also, the "<" sign can be get misinterpreted,
Maybe better to write your command into a batch file and call that from the TC button, to keep TC as interpreter out of the job.




 
User avatar
petermad
Power Member
Power Member
Posts: 16009
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Exiftool Command from ButtonBar

Post by *petermad »

2fidofido300
Try and put only exiftool.exe (with full path in the Command field. And then put the rest in the Parameters field - and if %f is an exiftool parameter then use %%f as also said by Dalai.

So:
Command: drive:\path\exiftool.exe
Parameters: -ext '*' '-FileName<%%f.$FileTypeExtension' -r ../images "%P"

When %P is used alone, TC does not put quotes automatically if there are spaces in the path - hence "%P".
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
fidofido300
Junior Member
Junior Member
Posts: 28
Joined: 2003-07-28, 16:55 UTC

Re: Exiftool Command from ButtonBar

Post by *fidofido300 »

Thank you for your replies
I have tried all the advice but I have not managed to get the solution. command works at the cmd or pwsh but even using batch file its not working.
and its executed very rapidly so I can't see the error.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6954
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Exiftool Command from ButtonBar

Post by *Horst.Epp »

fidofido300 wrote: 2024-07-21, 13:11 UTC Thank you for your replies
I have tried all the advice but I have not managed to get the solution. command works at the cmd or pwsh but even using batch file its not working.
and its executed very rapidly so I can't see the error.
Start the batch file with cmd /k yourbatch
and you see what happens without any timing.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
fidofido300
Junior Member
Junior Member
Posts: 28
Joined: 2003-07-28, 16:55 UTC

Re: Exiftool Command from ButtonBar

Post by *fidofido300 »

Thank You
Solved

Code: Select all

TOTALCMD#BAR#DATA
"C:\Program Files\totalcmd\Addons\Utils\exiftool\rename.bat"
%P%N
C:\Program Files\totalcmd\Addons\Utils\exiftool\exiftool.exe
Set all images to their MIME type by fidofido300
"C:\Program Files\totalcmd\Addons\Utils\exiftool\
-1
-1
rename.bat

Code: Select all

echo ON
"c:\Program Files\totalcmd\Addons\Utils\exiftool\exiftool.exe" -ext "*" "-FileName<%%f.$FileTypeExtension" -r %1 %2
pause
delete Echo On and Pause
User avatar
Dalai
Power Member
Power Member
Posts: 9949
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Exiftool Command from ButtonBar

Post by *Dalai »

You only need to double the percent signs when the parameter is specified in TC's parameters field. It doesn't need to be doubled in TC's command field or within a batch file.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Fla$her
Power Member
Power Member
Posts: 2985
Joined: 2020-01-18, 04:03 UTC

Re: Exiftool Command from ButtonBar

Post by *Fla$her »

2fidofido300
This is done like this:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\Utils\exiftool\exiftool.exe "-FileName<%f.$FileTypeExtension" -q -r
%V
Addons\Utils\exiftool\exiftool.exe
Fix the extensions of all images in the folder structure under the cursor

1
Overquoting is evil! 👎
User avatar
fidofido300
Junior Member
Junior Member
Posts: 28
Joined: 2003-07-28, 16:55 UTC

Re: Exiftool Command from ButtonBar

Post by *fidofido300 »

@Dalai
Double percent is according to exiftool documentation. Apparently its needs to be doubled in batch files. :)

2Fla$her
Your version works on single files. I want to process folders. :)

Thank you both
Fla$her
Power Member
Power Member
Posts: 2985
Joined: 2020-01-18, 04:03 UTC

Re: Exiftool Command from ButtonBar

Post by *Fla$her »

2fidofido300
If there is a folder under the cursor, then the button works as described in the tooltip.
If you want the work to be done in the active panel folder, replace %V with a dot (it can be moved to the end of the first field).
Overquoting is evil! 👎
Post Reply