Paste into Multiple Folders ?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
VeeGee

Paste into Multiple Folders ?

Post by VeeGee »

Good afternoon,
Recently I had to add a file to many, many folders (.nomedia file for Kodi). I created the file, select/copied it, used Search to find all my Extras folders, inside of Search Results I selected all the folders, right-click and Paste. The .nomedia file was only copied to the last selected folder and not all of them.

I also tried a smaller experiment in the file pane and not within Search Results and had the same end result.

Is it not possible to paste into multiple selected locations (w/o the use of scripting) ? or am I missing some option/method. For now, I ended up right-clicking on each folder, paste, next folder, repeat.

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Paste into Multiple Folders ?

Post by highend »

Afaik not possible without scripting (but I may be wrong)
One of my scripts helped you out? Please donate via Paypal

VeeGee

Re: Paste into Multiple Folders ?

Post by VeeGee »

I revisited this today and came up with this script. Added it as a CTB and Hamburger entry and it's working perfectly. Do you have any improvements for the script that would recommend ? or good as-is ? :

Code: Select all

foreach($item, <get SelectedItemsPathNames |>) {
	$folder = gpc($item, "base");
	pasteto "$folder";
}
Since there doesn't appear to be a way to do this w/o scripting, would it be possible to move this over to Wishes and see if Don could add this as a feature request ?

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Paste into Multiple Folders ?

Post by admin »

If more than one folder is selected in the file list and then you paste via context menu or just by Ctrl+V then I think it would be okay to copy the clipboard (copy only, not cut) contents to all of those folders. So what you expected to work in your first post should have just worked. It would be a new feature, but IMO I should add it and it should just work (no settings or new commands necessary).

Any objections?

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Paste into Multiple Folders ?

Post by admin »

Looked into it and saw complications building up. Given the rareness of this demand I think the script above is the perfect solution.

VeeGee

Re: Paste into Multiple Folders ?

Post by VeeGee »

Thank you for taking the time to look into it. The script option is working great. I'll continue to use this method.

jerryzak
Posts: 4
Joined: 07 Feb 2022 05:34

Re: Paste into Multiple Folders ?

Post by jerryzak »

Well, I often have similar need to copy the same file into multiple folders.

I tried the script method and I am encountering rather surprising problem:
the script runs as intended BUT the file is copied ONLY up to 17 times.

If I select a large number destination folders, only the first several folders (typically anywhere between 14 to 17) will get it.

Then I see the stripped white-and-blue "Non-completed Background Jobs" icon turning.
If I click on it, I get a nice list with many entries, all similar to this:

Loading Copy "<source path goes here>\.filename.1.txt", target: "<destination path goes here>\<destination folder>" Parallel. Initiated: 2/6/2022 10:44:05 PM

But the Jobs never finish...

Any suggestions how to fix this?

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Paste into Multiple Folders ?

Post by admin »

That's indeed a surprising problem. Can anyone confirm? (I have no time ATM)

autocart
Posts: 1248
Joined: 26 Sep 2013 15:22

Re: Paste into Multiple Folders ?

Post by autocart »

A simple quick test with 21 folders revealed no problems here.

EDIT:
Well, I just noticed a different problem:
When I have (1) Queue file operations off and (2) Custom Copy on and (3) also Create log file on
then some copy processes say of the log file that they can't write to it because it is used by another process.
Seems understandable when thinking about it, but one will mostly only think about it when he/she sees the error message. ;)

autocart
Posts: 1248
Joined: 26 Sep 2013 15:22

Re: Paste into Multiple Folders ?

Post by autocart »

I take that first "no problems found" report back.

At first it seemed fine because I did not pay attention to the status bar.
All copied files also show up in all target folders.
However, now I just realized that the status bar (and the background jobs list dialog) reports, as it seems, a few "hanging" copy processes.
The task manager confirms that, although task manager shows more such ones than the background jobs dialog.

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Paste into Multiple Folders ?

Post by admin »

Tested it now with 20 targets: works well in foreground and background, but it's recommended that you turn off "Show progress dialog" and "Keep progress dialog open" in Configuration | File Operations | File Operations | Custom Copy Operations | Configure...

jupe
Posts: 2794
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Paste into Multiple Folders ?

Post by jupe »

@jerryzak: I haven't time to test this, and not sure if it will suit your use-case but maybe if you adjust the script to force foreground ops so that the queue doesn't get used, and they are processed sequentially, would be one way to mitigate it, something like this:

Code: Select all

  setting "BackgroundFileOps", 0;
  foreach($fol, formatlist(<get selecteditemspathnamesslashed |>, "f",, "*\")) { pasteto $fol; }

autocart
Posts: 1248
Joined: 26 Sep 2013 15:22

Re: Paste into Multiple Folders ?

Post by autocart »

jupe wrote: 07 Feb 2022 22:38 ... so that the queue doesn't get used, and they are processed sequentially ...
Is not the queue exactly meant to process threads sequentially (opposed to parallel)?
So, you probably mean so that the queue is forced to be used?

jupe
Posts: 2794
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Paste into Multiple Folders ?

Post by jupe »

Well the issue as described (I haven't tested) seems to be ghost entries in the queue, so what I meant was that the whole sequence will complete, not get stuck in the sequence of updating the queue entries status's.

autocart
Posts: 1248
Joined: 26 Sep 2013 15:22

Re: Paste into Multiple Folders ?

Post by autocart »

ah, foreground instead of (queued or unqueued) background processing. Now I get it. Thanks for elaborating further. :tup:

EDIT: Yes, I think it helps. Based on my very simple test.

Post Reply