You can concatenate commands in cmd.exe /c, which will work if you don't have too many commands to run.
Code: Select all
exiftool = Path to Exiftool
Loop, C:\*
strCmds .= (strCmds ? " & " : "") """" exiftool """ """ A_LoopFileLongPath """"
objShell := ComObjCreate("WScript.Shell")
objExec := objShell.Exec(ComSpec " /c " strCmds)
while, !objExec.StdOut.AtEndOfStream
Exif[A_Index] .= objExec.StdOut.ReadAll()
}
Your StdOut stream will include the output from all the commands, not individually.
Using & unconditionally runs each command, && only runs if previous command succeeds, || only runs if previous command fails and you can group sets of commands with ( ).
So you could group and join your exif commands with && to stop as soon as an error occurs, and use || to append a command to throw an error eg exit /B 1.
Code: Select all
(exiftool path1 && exiftool path2 && exiftool path 3) || exit /B 1
Maximum command line length is 8191, so you might want to add a check in the file loop to stop before exceeding that length, run the commands and then process the next batch of files.
Cheers