Page 1 of 1

Move files/folder from multiple source into one target path using windows shell

Posted: Sun Nov 05, 2023 3:53 am
by byzod
I try to write an autohotkey script to extract content of selected folder to the parent level, but found a problem that the windows shell
movehere
or
copyhere
seems do not support contents from multiple source (details here)

I try to do this because I know Everything can do this: you can search files with the same name from different folders, drag them and it will trigger a standard overwrite warning which is what I want to imitate
(This image shows that I can trigger a overwrite warning for three
t.txt
from 3 different folders, which is unlikely to do so in vanilla explorer without Everything)
1.jpg
1.jpg (185.22 KiB) Viewed 2426 times
However after some search and reading official document, I didn't found a way to construct a custom
FolderItems
that can pass to
Folder.MoveHere
,
FolderItems
have only 1 implemented method:
Item()
which returns a item at given index, there's no
AddItem()
, nor
Append()


@void how do you do this? Are you write your own shell extension for this? Can you provide some information about this please? 🙏

p.s. If it's possible to do the "extract contents of selected folders (or an array of selected folder paths) to parent folder" with Everything command line is also a solution to me

Re: Move files/folder from multiple source into one target path using windows shell

Posted: Sun Nov 05, 2023 3:59 am
by void
It's not easy.

Everything uses a virtualized IShellFolder with CDefFolderMenu_Create2 for the context menu.

Everything uses IFileOperation for Edit -> Move to

Everything uses SHFileOperation on XP and earlier for Edit -> Move to

Re: Move files/folder from multiple source into one target path using windows shell

Posted: Sun Nov 05, 2023 4:03 am
by byzod
void wrote: Sun Nov 05, 2023 3:59 am It's not easy.

A virtualized IShellFolder with CDefFolderMenu_Create2
Well, then it is my worst guess, I think there's no easy way ;_;
Then I choose live with 99 overwrite warning until I got the courage to mess with shell extension

Thanks for your hard work of Everything, it's really a life changer ♥

Re: Move files/folder from multiple source into one target path using windows shell

Posted: Sun Nov 05, 2023 4:04 am
by void
Check out IFileOperation.