"New folder with selection": move selected files to a new created folder

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
DaveCmd
Junior Member
Junior Member
Posts: 15
Joined: 2017-07-18, 15:36 UTC

Re: "New folder with selection": move selected files to a new created folder

Post by *DaveCmd »

2beb, 2petermad
Thank you, I appreciate pointing me to the documentation and providing supportive explanations. The community here is really positive!
This was a bit of a journey for me. I have always said there is really nothing Total Commander cannot do, when it comes to file and folder management, now I believe this even more.
Petermad, your Extended Menus enhancements are a wealth of learning about how configurable Total Commander is. With Ghisler's tool, you, have essentially create an operating system within an operating system.

Once again, a heartfelt thank you.
Last edited by DaveCmd on 2023-12-10, 18:06 UTC, edited 1 time in total.
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: "New folder with selection": move selected files to a new created folder

Post by *beb »

2DaveCmd
You're welcome.
petermad wrote: 2023-12-10, 10:21 UTC Run:

Code: Select all

hh.exe %COMMANDER_PATH%\TOTALCMD.CHM::dlg_choosecommand.htm
Run:

Code: Select all

hh.exe %COMMANDER_PATH%\TOTALCMD.CHM::dlg_configbuttonbar.htm
2petermad
Oh, I didn't even know that such an approach to pointing to a help section existed.
Thank you.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: "New folder with selection": move selected files to a new created folder

Post by *Fla$her »

DaveCmd wrote: 2023-12-10, 16:34 UTC I have always said there is really nothing Total Commander cannot do, when it come to file and folder management,
With the help of auxiliary content — plugins, utilities, scripts, otherwise this is a big exaggeration. ;)
No FM is without its flaws.
beb wrote: 2023-12-10, 17:09 UTC Oh, I didn't even know that such an approach to pointing to a help section existed.
petermad often posts these commands (1, 2, 3, 4, 5 etc.).
Those that can be deployed in the tree, I prefer to open with TCFS2 because it's noticeably faster.
Overquoting is evil! 👎
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: "New folder with selection": move selected files to a new created folder

Post by *sa16 »

2DaveCmd
You can probably do with one em-command if you edit the folder name (if necessary) in the rename dialog:

Code: Select all

[em_moveallnewdirother0]
cmd=cm_RenMov
param=/G0T="%Q%T%O\"
Or is it not what you need?

Why create a folder with the cm_MkDir command if it is created by the cm_RenMov command with parameters?
User avatar
DaveCmd
Junior Member
Junior Member
Posts: 15
Joined: 2017-07-18, 15:36 UTC

Re: "New folder with selection": move selected files to a new created folder

Post by *DaveCmd »

2sa16
Hello! I tried your code and it is more robust for the job of moving the selected elements into a new folder to the target panel. It handles renaming the folder better. Thanks for that.
I still think I need to use the 2 em_command code for moving selected elements into a new folder in the source panel, am I correct?
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: "New folder with selection": move selected files to a new created folder

Post by *sa16 »

DaveCmd wrote:code for moving selected elements into a new folder in the source panel
In my opinion, it is enough to remove %T in the previous command:

Code: Select all

[em_moveallnewdir0]
cmd=cm_RenMov
param=/G0T="%Q%O\"
User avatar
DaveCmd
Junior Member
Junior Member
Posts: 15
Joined: 2017-07-18, 15:36 UTC

Re: "New folder with selection": move selected files to a new created folder

Post by *DaveCmd »

2sa16
I tried your code and it works well. A nice alternative, as it allows for more configurability with the Rename/Move prompt. when one needs more options than the simple folder rename prompt.

I am very pleased with the help I received in learning what I call DEEP Total Commander :D
I lovingly created a new icon for the procedure and added it to my button bar.
Here is the PNG version in case you are curious. I have an .ico version but imgbb.com does not accept that file type. If people are interested I can host the /.ico file somewhere else.

Icon for "Move selection into new folder, rename as under cursor": https://i.ibb.co/HKtCjH5/Moveinto-Folder.png
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: "New folder with selection": move selected files to a new created folder

Post by *sa16 »

2DaveCmd
If you do not want to edit the folder name, you can specify /G instead of /G0.

You can specify %|$DATE:Y.M.D_h-m-s| as the folder name (instead of %O).
User avatar
DaveCmd
Junior Member
Junior Member
Posts: 15
Joined: 2017-07-18, 15:36 UTC

Re: "New folder with selection": move selected files to a new created folder

Post by *DaveCmd »

2sa16
Thank you again, I will play with that.
User avatar
DaveCmd
Junior Member
Junior Member
Posts: 15
Joined: 2017-07-18, 15:36 UTC

Re: "New folder with selection": move selected files to a new created folder

Post by *DaveCmd »

2sa16
Update: I got your "date for folder name" working with this new command:

Code: Select all

[em_moveallnewdirsrcdate]
cmd=cm_RenMov
param=/GT="%Q%P%|$DATE:Y-M-D| - %O\"
As you can see it takes anything selected and adds it to a new folder in the source directory, with a folder name that is the date, a spaced dash, and the filename/foldername under the cursor. Perfect!
So I get a nice folder named: "2023-12-15 Settings backup", for example.

I also made an icon for this called MoveIntoFolder_DateName.png
https://i.ibb.co/QNccz82/Move-Into-Folder-Src-Date-Name.png

Thanks once again. I appreciate your extra help!
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: "New folder with selection": move selected files to a new created folder

Post by *sa16 »

2DaveCmd
In my opinion, the %P parameter is redundant here.
The parameter %Q is also redundant in all the proposed examples except the first: /GT="%Q%N\".
But they don't get in the way!
User avatar
DaveCmd
Junior Member
Junior Member
Posts: 15
Joined: 2017-07-18, 15:36 UTC

Re: "New folder with selection": move selected files to a new created folder

Post by *DaveCmd »

2sa16
Your opinion is fact! Thanks for tightening up my code. I fully admit, I am a bit of a "cut & paste" coder :oops: :roll:
Post Reply