Copy one file to many directories/subdirectories
Moderators: Hacker, petermad, Stefan2, white
Copy one file to many directories/subdirectories
Hi, is it possible to have a feature that allows me to copy on file to many folders at once?
I have an audio book in 15 directories. I would like to copy one file into all of the directories in "one operation" To day I have to copy it 15 times to all the directories. PIA
In left pane I have picture.jpg that I would like to copy right pane, c:\audio\1\, and to c:\audio\2\, and so on.
Just add a feature to F5 that says "Copy file to all marked folders"
I have an audio book in 15 directories. I would like to copy one file into all of the directories in "one operation" To day I have to copy it 15 times to all the directories. PIA
In left pane I have picture.jpg that I would like to copy right pane, c:\audio\1\, and to c:\audio\2\, and so on.
Just add a feature to F5 that says "Copy file to all marked folders"
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 11.03 / Win10 x64
Using TC 11.03 / Win10 x64
2Rimdur
If you need to copy only 1 file at a time into these directories, you can simply use this Batch:Save this as a text file named e.g. TC_Copy2MultiDirs.cmd.
You can use it as a button, in starter menu or as user-defined command, like this:(with "X:\path" changed to where you saved the file)
Ready with setting up.
To use it, in TC
The "pause" in the 3rd line is to let you have a look at the copy results (in case there was an error).
If you need to copy only 1 file at a time into these directories, you can simply use this Batch:
Code: Select all
@echo off
for /F "usebackq tokens=* delims=" %%e in (%2) do (copy "%~1" "%%~e")
pause
You can use it as a button, in starter menu or as user-defined command, like this:
Code: Select all
Command : X:\path\TC_Copy2MultiDirs.cmd
Parameters: "%T%M" %L
Ready with setting up.
To use it, in TC
- put the cursor onto the file you wish to copy, then
- switch to the other panel and mark all directories, that you want to copy the file to
- then just call the above command (button, menu - wherever you stored it)
The "pause" in the 3rd line is to let you have a look at the copy results (in case there was an error).
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!
@ StatusQuo:
I see Rimdur understood what you meant and it worked for him. Unfortunatelly, it didn't for me
I'm probably not doing something right.
So, I opened the notepad and pasted the code you said above:
@echo off
for /F "usebackq tokens=* delims=" %%e in (%2) do (copy "%~1" "%%~e")
pause
save it as: TC_Copy2MultiDirs.cmd
I saved it in TC dir (even though I don't think that location matters, so ignore this info if redundant).
Then Start>Change start menu>
Under Command I locate the .cmd file (or write the path to the file with the file and the extension...same thing)
Under parameters I put "%T%M" %L
Should I put something under "Start path" field?
Then I click OK.
Next, (with right click) mark the file on the left side of TC; Then mark destination directories on the right side; Click anywhere in the left field; Start(menu)>Copy2MultiDirs (this is the title I assigned)
and nothing happens, there's only a blink of a window that appears and disappears in the same moment.
I followed you instructions a few times and tried something else, but that time after clicking Start>Copy2MultiDirs, Win explorer opened the folder where the .cmd file is saved.
Could you please tell me what I am doing wrong. First time doing this, btw.
...can this issue be to the fact I'm on company's comp?? not really...
Thank you.
vo
I see Rimdur understood what you meant and it worked for him. Unfortunatelly, it didn't for me

I'm probably not doing something right.
So, I opened the notepad and pasted the code you said above:
@echo off
for /F "usebackq tokens=* delims=" %%e in (%2) do (copy "%~1" "%%~e")
pause
save it as: TC_Copy2MultiDirs.cmd
I saved it in TC dir (even though I don't think that location matters, so ignore this info if redundant).
Then Start>Change start menu>
Under Command I locate the .cmd file (or write the path to the file with the file and the extension...same thing)
Under parameters I put "%T%M" %L
Should I put something under "Start path" field?
Then I click OK.
Next, (with right click) mark the file on the left side of TC; Then mark destination directories on the right side; Click anywhere in the left field; Start(menu)>Copy2MultiDirs (this is the title I assigned)
and nothing happens, there's only a blink of a window that appears and disappears in the same moment.
I followed you instructions a few times and tried something else, but that time after clicking Start>Copy2MultiDirs, Win explorer opened the folder where the .cmd file is saved.
Could you please tell me what I am doing wrong. First time doing this, btw.
...can this issue be to the fact I'm on company's comp?? not really...
Thank you.
vo
Wow! Wait, now it worked! o_O ?
I stayed in the right field and it was fine now. Yesterday when I stayed in the right (destination) field it copied directories to the left instead of the file to the right...
If you know what could be the mistake, please let me know. If not - ignore this post
Thanks.
vo
I stayed in the right field and it was fine now. Yesterday when I stayed in the right (destination) field it copied directories to the left instead of the file to the right...
If you know what could be the mistake, please let me know. If not - ignore this post

Thanks.
vo
2vo
This thread was from 2008!
Meanwhile these workarounds are no longer necessary.
Holger
This thread was from 2008!
Meanwhile these workarounds are no longer necessary.
RegardsHistory.txt wrote:10.11.10 Release Total Commander 7.56 beta 1
...
29.10.10 Added: F5 copy, option "Copy to all selected folders/links": When normal files are selected, copy to the directories of these files after search - feed to listbox (only if there is no target dir)
Holger
white wrote:What does that mean?When normal files are selected, copy to the directories of these files after search - feed to listbox (only if there is no target dir)
Yes, it may mean something like this:HolgerK wrote:Maybe:
- You can search for a single filename
- feed the result to the listbox
- select them as target
- and overwrite these files at once with a newer version.
When files are selected in the target folder, all source files are copied to the folders of the target files. But only if the target windows contains a search results list. For instance, when using TC 7.55a and selecting a folder and a file in a normal target window, source files are only copied to selected the folder.
Then there was a fix for branch view:
Now it does not matter whether or not the target window contains a folder listing or not. When selecting a folder and a file in a normal target window, source files are copied both to the selected folder and to the folder of the selected file. So it seems it no longer works as designed.(28.11.10) Fixed: F5 copy, option "Copy to all selected folders/links": In branch view, the file was only copied to subdirs, not to the base dir, even if a file was selected there