How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

English support forum

Moderators: white, Hacker, petermad, Stefan2

oko
Senior Member
Senior Member
Posts: 201
Joined: 2007-05-03, 16:22 UTC

How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *oko »

How to easy copy selected files to oposite side into subfolder with the same name as source parent folder? E.g. from c:\dir1 (left side) to c:\dir2 (right side), so files would be finaly copied to c:\dir2\dir1.
Manual steps are:
  1. be in source window -
  2. Backspace (one level up) -
  3. Shift+F7, Enter (create same-named folder in oposite window) -
  4. Enter (go to new folder) -
  5. Tab (go to source window) -
  6. Enter (go to folder with source files) -
  7. Select files -
  8. F5 (copy to target)
.
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *sa16 »

2oko
Button:

Code: Select all

TOTALCMD#BAR#DATA
cm_Copy
/G /T="%T%B\"
wcmicons.dll,62



-1
oko
Senior Member
Senior Member
Posts: 201
Joined: 2007-05-03, 16:22 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *oko »

2sa16
thank you. One more thing please. After copy I would like to be in the target subfolder in target window (new files to be shown).
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *sa16 »

2oko
Somehow so...
Command chain for button:

Code: Select all

em_CopyTarget%B, cm_ClearAll, cm_FocusTrg, em_cd%BT
usercmd.ini:

Code: Select all

[em_CopyTarget%B]
cmd=cm_Copy
param=/G /T="%T%B\"
[em_cd%BT]
cmd=cd
param=%BT
If you want to remain in the original panel, add a cm_FocusTrg at the end of the chain.
oko
Senior Member
Senior Member
Posts: 201
Joined: 2007-05-03, 16:22 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *oko »

sa16 wrote: 2024-02-08, 18:20 UTC 2oko

Code: Select all

em_CopyTarget%B, cm_ClearAll, cm_FocusTrg, em_cd%BT
It does not work. Because copying lasts some time and next commands are executed immediatelly. Maybe solution would be create and go to new target dir first and copy after all.
Fla$her
Power Member
Power Member
Posts: 2324
Joined: 2020-01-18, 04:03 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *Fla$her »

2oko
With TCFS2:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef
tem(`cm_Copy /B1GO5ST="%T%B\"`) delay(200) "tcd(,<`%T%B`>,S)" tcm(4006)
wcmicon2.dll,63
Copy the selected items to the same-name folder on another panel
Last edited by Fla$her on 2024-02-10, 11:50 UTC, edited 1 time in total.
Overquoting is evil! 👎
oko
Senior Member
Senior Member
Posts: 201
Joined: 2007-05-03, 16:22 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *oko »

Delay or wait is not usable, because copy can last 0,1 sec. or 8 hours.
Fla$her
Power Member
Power Member
Posts: 2324
Joined: 2020-01-18, 04:03 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *Fla$her »

The delay is needed not to wait for the copy to be completed, but to wait for the folder to be created. No need to wait for the background operation to complete in order to open a new folder on another panel and move the focus.
Overquoting is evil! 👎
oko
Senior Member
Senior Member
Posts: 201
Joined: 2007-05-03, 16:22 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *oko »

Thanks Fla$her.
Still I will welcome a solution without addons. I can't believe that such simple task would be impossible with tc commands.
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *AntonyD »

such simple task
why it should be a simple task? On your description is not possible to easily understand _HOW_ you will select those files - which should be copied in a new folder with the same name on an opposite panel? Because IF there is NO task to select _SOME_ files firsly - definitely that you simply should copy an overall folder (with all files inside it) from left panel to the right panel or vice versa.
Last edited by AntonyD on 2024-02-11, 18:37 UTC, edited 1 time in total.
#146217 personal license
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1013
Joined: 2004-07-29, 11:00 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *ZoSTeR »

 
There seems to be a problem switching between source/target while copying... even with cm_Wait

This works for me:

Code: Select all

em_MKDirTarget,cm_FocusTrg,em_cd_BT,cm_FocusTrg,em_CopyTarget,cm_ClearAll

[em_cd_BT]
cmd=cd
param=%BT

[em_CopyTarget]
cmd=cm_Copy
param=/G /B0 /T="%T\"

[em_MKDirTarget]
cmd=%COMSPEC% /c mkdir
param="%T%B\"
You create and jump to the target folder before copying.
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *sa16 »

2oko
It does not work.
And what's wrong? Are files not copied?
Fla$her
Power Member
Power Member
Posts: 2324
Joined: 2020-01-18, 04:03 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *Fla$her »

oko wrote: 2024-02-10, 13:54 UTC Still I will welcome a solution without addons.
The addon is suggested to avoid editing usercmd.ini.

2ZoSTeR
In the case of /B0, nothing needs to redo, but only if the user 100% doesn't want to press [Background].

2sa16
AlwaysCopyInBackground=1/2 (/B1 or /B2)
You can replace cm_ClearAll (it's already happening) with cm_Wait 200.
Overquoting is evil! 👎
oko
Senior Member
Senior Member
Posts: 201
Joined: 2007-05-03, 16:22 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *oko »

AntonyD wrote: 2024-02-10, 14:30 UTC
such simple task
why it should be a simple task? On your description is not possible to easily understand _HOW_ you will select those files - which should be copied in a new folder with the same name on an opposite panel? Because IF there is NO task to select _SOME_ files firsly - definitely that you simply should copy an overall folder (with all file inside it) from left panel to the right panel or vice versa.
Simple task because it is just copy selected files/folders to oposite side with one folder to create in addition - basic commands for file manager. As I found out since tc is some internal commands missing (e.g. cm_mkdir command with parameters to create required folder) the alternate ways have to be searched.
Selection is made manually by user in source file window before the required command is executed.
To copy all content of folder is unsuitable because it could be of huge size. Only selected content should be copied.
oko
Senior Member
Senior Member
Posts: 201
Joined: 2007-05-03, 16:22 UTC

Re: How to easy copy selected files to oposite side into subfolder with the same name as source parent folder?

Post by *oko »

Thanks to ZoSTeR this works:

Code: Select all

em_MKDirTarget,cm_Wait 20,cm_FocusTrg,em_cd_BT,cm_FocusTrg,em_CopyTarget

[em_cd_BT]
cmd=cd
param=%BT

[em_CopyTarget]
cmd=cm_Copy
param=/G /T="%T\"

[em_MKDirTarget]
cmd=%COMSPEC% /c mkdir
param="%T%B\"
It is a bit changed from ZoSTeR:
- cm_ClearAll is maybe unnecessary
- cm_Wait added because creation of dir takes some time to correctly continue with next commands
- /B0 in parameters in em_CopyTarget is unnecessary
Post Reply