0

What I am trying to do is list files including the file path, then add text and parentheses to them. So, i start with:

1.jpg

2.jpg

3.jpg

And I use

DIR /s/b /on *.JPG > LIST_JPG.DAT

To get them to be

c:/foldera/folderb/1.jpg

c:/foldera/folderb/2.jpg

c:/foldera/folderb/2.jpg

The next part I need to do is add text to the beginning that reads "exifread -TEXT" in front of it, and put parentheses around the

@ECHO OFF 

FOR %%i IN (*.JPG) DO ECHO exifread -TEXT "%%i"

Which gets me

exifread -TEXT " 1.jpg "

Which is so close, but what I need it to be is

exifread -TEXT "c:/foldera/folderb/1.jpg"

Any ideas? Any help is appreciated!

1 Answers1

0

Almost done

for %%a in (*.jpg) do echo exifread -TEXT "%%~fa"

Where %%~fa is the file referenced in replaceable parameter %%a but with full path. See for /? for the list of available modifiers

For a recursive version,

for /r "c:\foldera" %%a in (*.jpg) do echo exifread -TEXT "%%~fa"

That will do the same operation but for all .jpg files under the indicated starting folder and below.

MC ND
  • 69,615
  • 8
  • 84
  • 126