CD for multiple files/locations in MS-DOS Batch

Simple commands will run each line for every file before moving to the next line, so that command would CD to all the directories and then run exiftool on each file while CD's to the last file's dir.

You'd need to use scripting to change that (unless there's a way to tell ExifTool to only use the name in the output, but I am not sure about that).

There are a couple of ways a script could do this, but this is probably the best way with a command-line tool if you want to see all the output in a single Command Prompt window:

function OnClick(clickData)
{
	var cmd = clickData.func.command;
	cmd.ClearFiles();
	cmd.SetType("msdos");

	if (clickData.func.sourcetab.selected_files.count == 0) return;

	var lastPath = "";
	for (var eSel = new Enumerator(clickData.func.sourcetab.selected_files); !eSel.atEnd(); eSel.moveNext())
	{
		var item = eSel.item();
		if (lastPath != item.Path)
		{
			cmd.AddLine('CD /D "' + item.Path + '"');
			lastPath = item.Path;
		}
		cmd.AddLine('ExifTool -progress -echo "Creating JSON file(s)..." -w %%f.%%e.json -json -struct -G -PDF:All -XMP:All "'
			 + item.name + '"');
	}
	cmd.AddLine('pause');
	cmd.Run();
}

I don't have ExifTool installed to test that works, but it should work in theory. Try it on a test folder first in case it does something wrong.