How to? issue with % and evaluation

Oct 18, 2008
Hello -- I am having and issue with the tool/program exiftool

it seems that some of the command line switches will use % as part of tag to indicate a replacement value, ie %f will replace %f with the filename, so a command line might look like

exiftool -w %f .....

I have exiftool set up as batfile to get to the location where its located, then that bat file runs exiftool.exe

my issue is when at the cmd prompt I issue

exiftool -w %f .....

The first level of evaluation removes %f (%f does not have any value)

so I then tried

exiftool -w %%f .....

Which sort of worked —

in the exiftool batfile, %1$ — did have ...... %f ... in it (one of % was removed ), but
when later in the batfile I ran

exiftool.exe .....

the “%f” was removed and what was left was

exiftool -w

is there a way to “escape” the “%f” at the command prompt, so when the exiftool (.exe) run is
sees ..... -w %f

Oct 18, 2008
well sort of --- as noted if I specify at the cmd prompt that runs the batfile

exiftoot .... -w %%f .....

then in the bat file %1$ will have the correct string in it, ie

-w %f

but then if in the bat file I have

setdos /x-3
exiftool.exe %1$
setdos /x+3

%1$ will not get evaluated --- that is the issue using setdos

Charles Dye

Super Moderator
Staff member
May 20, 2008
Albuquerque, NM
I'd be tempted to substitute some other character for the percent sign. Say, ~f instead of %f. Then, in the batch file, replace it only when actually passing it on to the external: exiftool.exe %@replace[~,%%%%,%args]
Oct 18, 2008
yes -- that would be the best solution ... as it turns out exiftool does not have a way to change % to something else and since with cmd.exe, %%f on the cmd prompt would do the "right thing" @replace would make sense with tcc
Similar threads
Thread starter Title Forum Replies Date
G v28 Display Issue Support 7
Jay Sage Issue with CD_ENTER Alias Support 37
Jay Sage Issue with CD_LEAVE Alias Support 3
cgunhouse Standard User Account Issue Support 2
samintz WAD Display wrapping issue Support 5
M TCC color issue in ConEmu Support 4
samintz Timer issue Support 4
Alpengreis Documentation Minor issue in help file for view /E Support 1
samintz WAD ANSI issue Support 3
D TCSTART issue after reinstallation Support 14
A Documentation [Help file] OPTION "//" synopsis formatting issue Support 0
Chen Touboul Overtyping issue - i press the Insert key, help till press enter for new line in TCC Support 2
Y TCC and Cmder imcompatibility issue Support 7
M Another possibly strange remote registry issue Support 5
T WAD bpokestr issue Support 5
D High-DPI Scaling issue Support 1
S CMDebug 22 issue with del command Support 1
cgunhouse Foldermonitor Issue Support 7
samintz Build 38 Install issue Support 5
rps WAD Setlocal issue Support 4
Luiz Rodrigues Issue with Maven Support 1
Seven Update / install issue with take command Support 7
Fross WebDav Drive Mapping Issue Support 19
D Upgrade issue Support 3
Fross V20b8 Everything Issue Support 5
T TCC display issue Support 1
cgunhouse _logfile Issue Support 5
T Fixed Querybox issue Support 1
cgunhouse Fixed Share Memory Issue Support 5
cgunhouse Foldermonitor with "/E" Option Issue Support 6
Fross TabComplete Argument Issue Support 1
fpefpe How to? Stange start up issue Support 1
C cosmetic issue with LIST's (I) Support 9
jbarnes1967 TC 18.00 x64 issue with lua io.popen() Support 2
D How to? Wildcards as sets - looping issue with FOR and REN Support 7
T WAD Free issue Support 6
R Fixed v17.0.54 Tab->COMSPEC Dialog Box Issue Support 2
R Minor Cosmetic Issue in Take Command Window Support 2
cgunhouse One line IFF ... Then ... Else ... EndIFF Statement issue in V17 Support 13
cgunhouse IFTP Path Issue in V17 - Fixed Support 7
S BDEBUGGER issue Support 9
cgunhouse @ISPROC Issue Support 15
cgunhouse TCMD.INI Issue Support 7
T Fixed multi-line alias issue Support 13
R WAD issue with filename completion with system and hidden files Support 8
D Strange issue with FOR loop Support 15
C Install Issue with 3rd Party Privelege Escalation Support 2
W Button command issue Support 5
S XenForo issue Support 8
nikbackm Fixed v15: Issue with @select Support 3

Similar threads