I have a Windows command file script that needs to read the value of a tag from the EXIF data of a file and pass it as an argument when it calls a program.
Is it possible for ExifTool to copy the value of a tag to an environment variable? I could then use the variable in the calling statement.
Thank you
Does it need to be set as an ENV variable? It seems it would be easier to directly save it to a batch variable.
Using this as the batch file
FOR /F "tokens=*" %%g IN ('exiftool -s3 -Description "y:\!temp\Test4.jpg" ') do (SET VAR=%%g)
echo %VAR%
Output:
PS C:\> exiftool -Description y:\!temp\Test4.jpg
Description : New Description
PS C:\> .\test.bat
C:\>FOR /F "tokens=*" %g IN ('exiftool -s3 -Description "y:\!temp\Test4.jpg" ') do (SET VAR=%g )
C:\>(SET VAR=New Description )
C:\>echo New Description
New Description
Otherwise, exiftool doesn't have the ability to directly save to an ENV variable.
A DOS batch variable would work. Thank you!