Shell ExifTool from Excel VBA

Started by Betj, March 20, 2017, 10:46:30 AM

Previous topic - Next topic

StarGeek

The -@ ARGFILE is what you want.  Filenames are arguments.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

l.willms

Quote from: Betj on March 23, 2017, 10:03:44 AM
Thanks. I tried to use WScript.Shell and also PowerShell.

I fall very quickly into problems or subtleties that I am not able solve. For example I can see that "my"  WScript.Shell  object does not support the Exec method, but the Run method instead, showing that it is not the same as yours!

Which level of Excel are you using?
On which level of MS Windows?

In your Excel VBA Editor, have you added the reference to "Microsoft Scripting Runtime"? (Menu "Extra", item "References" (in German it is called "VErweise", and in english Excel that should be "Refernces").

OTOH, the previous reply in this thread indicated that, apparently yes, you can indicate on the ExifTool command line a file with -@ ARGFILE the files which want to work with.

Betj

Hello, I am back again after some unintentional few days out.

QuoteThe -@ ARGFILE is what you want.  Filenames are arguments.
Sorry now I can see that I have difficulties not only with the programming language, but also with the English language!

This string works:
strCommand = "Cmd /c C:\Tmp\ExifTool.exe -Comment C:\Tmp\378.jpg -W+! C:\Tmp\ExifToolTmp.txt"

I want to do the same for a number of files
I have the list of these files in the text file named C:\Tmp\MyFileList.txt
     C:\Tmp\378.jpg
     C:\TMP\385.jpg
     C:\Tmp\419.jpg


I was expecting a command like this would work:
strCommand = "Cmd /c C:\Tmp\ExifTool.exe -Comment @ C:\Tmp\MyFileList.txt -W+! C:\Tmp\ExifToolTmp.txt"

But not! I get

File not found: @
======== C:/Tmp/MyFileList.txt
Error: Unknown file type - C:/Tmp/MyFileList.txt
    1 image files read
    1 files could not be read
-- press RETURN --



QuoteIn your Excel VBA Editor, have you added the reference to "Microsoft Scripting Runtime"?
Yes it is checked. I run on Windows 10 Version 10.0.14393, with Microsoft Office 2007.

StarGeek

You forgot the dash.
-@ C:\Tmp\MyFileList.txt

I'm on my mobile so I'm sorry I can't be more explicit with my instructions.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Betj