Copy Duplicate in silent?

I am trying to duplicate selected files and folders (in the same active directory) and silent rename the new files if there are name conflicts.

I found this thread, the code works only on files but folders I get an error that says:

You cant move or copy a folder into it self.

Looking at the documentation, there is a duplicate sub command, I tried combinning it with Copy WHENEXISTS=rename like so:

 copy duplicate,WHENEXISTS=rename

No luck, It does not work at all. Any ideas what I might be doing wrong here? Thanks!

This works from a quick test:

Copy DUPLICATE AS=* WHENEXISTS=rename

Thanks for the help Leo. I just tested, sadly I get the same error when I try it on a single folder:

Command I gave only works on files...

But, taking a step back, why not just use Ctrl-C, Ctrl-V?

I see, I understand.

But, taking a step back, why not just use Ctrl-C, Ctrl-V?

I am one of those hopeless fools that imposes upon themselves single key triggers only.
This is something I do all the time across many other tools, Hit D on keyboard 2 to Duplicate selected items.

I quess I will pass the task to powershill via DopusRT.

Can I please place a feature request for this to work on folder objects as well? The Duplicate sub commands does what I need perfectly fine it just needs to support WHENEXISTS=rename so to avoid the dialog box. Thanks for the help!

You could do it with Copy DUPLICATE AS="* (1)" but that's going to put the number after the extension when it's a file, which you probably don't want.

A script could alter the pattern so it works with both files and folders. (Or a simple command could do it, if you only need to run it on one thing at a time.)

Hmm. I will into both of your suggestion and see.