Run multiple command lines as a single file operation?

When operating files to different directories, is it possible to record all operations as one? Convenient for one-time undo.

Command lines:

cmd.AddLine('Rename "' + item + '" TO="' + fdr + '\\*"')
cmd.AddLine('Rename "' + item + '" TO="' + fdr2 + '\\*"')

Command objects:


cmds[i].AddFile(item)
...
cmds[i].AddLine('Rename TO="' + fdr + '\\' + '*"' + ' AUTORENAME');
...
for (var i=0; i<cmds.length; i++){
	cmds[i].Run()
}

There is a similar post, but it looks like it can be solved with "Embedding Rename Scripts".
Or run an additional jscript after the rename command from "Embedding Rename Scripts" has run?

Doing it via Rename would work, since Rename can send each file to a different place if it wants to. You'd need something like a rename preset that contains a script that decides where to put the files.

But doing it that way, you won't get as good progress dialogs when moving large files between drives (while Rename is able to do that, it's not really what it was designed for).

Yes, but I want to perform other actions after completion, like clearing empty folders.