How to execute multiple commands in one line

Started by johnbieber1993, October 13, 2021, 12:48:15 PM

Previous topic - Next topic

johnbieber1993

Is this even possible? I apologize in advance for the noob question. I really suck at this but I'm trying my best to familiarize myself with command prompt.

For example, I want to execute six commands in a single go. The commands are:

exiftool -City=Paris "C:\Users\JohnBieber\Images"
exiftool -CountryCode=FRA "C:\Users\JohnBieber\Images"
exiftool -Location="Rue de Marseille" "C:\Users\JohnBieber\Images"
exiftool -Subject="Window Repair, Door Installation, Floor Maintenance" "C:\Users\JohnBieber\Images"
exiftool -GPSLatitude=48.87172395889533 "C:\Users\JohnBieber\Images"
exiftool -GPSLatitude=2.3635048980532263 "C:\Users\JohnBieber\Images"

Is it possible to execute them all in one command? Thank you to whoever will answer.

StarGeek

Just put them all in one command, as per Note #1 under the -TAG[+-^]=[VALUE] option.  Also see the Writing Examples.

Though understand your commmand for Subject will replace any existing keywords and will make one single long keyword of
Window Repair, Door Installation, Floor Maintenance

If you want these to be separate keywords and you don't want to remove any existing keywords, you add them individually using +=
-Subject+="Window Repair" -Subject+="Door Installation" -Subject+="Floor Maintenance"
or use the -sep option
-Subject+="Window Repair, Door Installation, Floor Maintenance" -sep ", "
Also take note that exiftool will not remove duplicates if you add the same keyword more than once.  See FAQ #17 for details on working with list type tags.
"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

johnbieber1993

Hello. Thank you so much for your help. I almost messed up had you not pointed that out. Also - am I right for using the command -Subject= to remove the duplicates? Just want to be sure.

Phil Harvey

Hi John,

Quote from: johnbieber1993 on October 13, 2021, 08:04:51 PM
am I right for using the command -Subject= to remove the duplicates?

Yes.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Using
-Subject=
by itself removes all the keywords.  The FAQ link above tells you how to prevent duplicates when you add new keywords.  The other option would be to run a second command using the NoDups helper function.  An example command for that is at that link.
"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