How to move all files in the A folder to the B folder, but do not move the A folder

Hey @guxianbang,

The trouble you're having is that the Move or Rename a File action does not support wildcards.

For that you have to resort to an Execute a Shell Script action.

Here's a basic example:

Move Files from Source Directory to Destination Directory v1.00.kmmacros (5.9 KB)

Personally I would do all of this in the single Execute a Shell Script action, but I broke it up to make adding paths easier for people unaccustomed to the shell.



You cannot use wildcards/globbing with the Move or Rename a File action, but this is easily done with the For Each action and the Folder Contents collection.

[Moderator: Fix typo. "%Varible" should be "%Variable"]



Peter, this is easy to write, but I wonder how scalable it is.
Any idea about the performance for 100 items? for 1,000+ items?

Probably about 50+/second.

The OP showed a folder with a dozen items - fast enough for that.

Thank you very much for your answer!

1 Like