Creat folder and move files to folder

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
TotalRobbie
Junior Member
Junior Member
Posts: 20
Joined: 2020-02-08, 09:04 UTC

Creat folder and move files to folder

Post by *TotalRobbie »

Image: https://drive.google.com/file/d/1352S_O2kcYLNQTg5RNuNMs_8iYw4PAUL/view

So a folder has to be created on the other window of total commander.
Named the active file selection.
(TextEdit Pro 23.3.0).

Then the selected file(s) must be moved to the created folder.

That is of course possible with the F7 button and a copy action
But I would like to do this in one go.

How can help me with this?
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Creat folder and move files to folder

Post by *Stefan2 »

BASE name of selected file is hold in TC var "%O"

DOS commands together with TC variables:
MD "%T\%O" & COPY "%N" "%T\%O"


This command works with one selected file only.
If you have more than one selected, who should know how the target folder should be named?

In Help search for button and read "Dialog box: Configuration - Change button bar"




.
User avatar
petermad
Power Member
Power Member
Posts: 14787
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Creat folder and move files to folder

Post by *petermad »

2TotalRobbie

You can use this em_command for it (put it in your usercmd.ini file)

Code: Select all

[em_copyallnewdir]
cmd=%COMSPEC% /C
param=if not exist "%P" (echo ) else if not exist "%T" (echo ) else if exist %Y%P%S1\* (echo ) else if exist "%T%O" (echo ) else chcp 65001 && %%COMSPEC%% /C for /F "usebackq delims=" %%n in (`type %WL`) do if not exist "%%n\*" xcopy "%%n" "%T%O\" /H /R /K /Y
menu=Copy marked files to directory in opposite panel with name as file under cursor
button=wcmicons.dll,62
iconic=1
After the echo's there should be the character with the hex value 07 - it cannot be displayed on the forum.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
TotalRobbie
Junior Member
Junior Member
Posts: 20
Joined: 2020-02-08, 09:04 UTC

Re: Creat folder and move files to folder

Post by *TotalRobbie »

I am not familiar in this stuf.

where should i put the "usercmd.ini".
In the total commander folder ????

and what do you mean by After the echoes there should be the character with the hex value 07 - it cannot be displayed on the forum.???
can you send me this privately or is this also not possible via this form

Cant you send it to me email

zoek_me_maar@hotmail.com


thanks a lot
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Creat folder and move files to folder

Post by *Stefan2 »

TotalRobbie wrote: 2022-07-29, 13:07 UTC I am not familiar in this stuf.

where should i put the "usercmd.ini".
In the total commander folder ????

and what do you mean by After the echoes there should be the character with the hex value 07 - it cannot be displayed on the forum.???
can you send me this privately or is this also not possible via this form

Cant you send it to me email

zoek_me_maar@DELETED.com


thanks a lot


If you see "(ECHO  )"

write "(ECHO " , hold the Alt-key and press the 7 on the NumPad , next type the closing ")"

(ECHO •)

7 stands for bell (see https://www.rapidtables.com/code/text/ascii-table.html )



For info about usercmd.ini see f.ex.: viewtopic.php?p=344777#p344777



 
TotalRobbie
Junior Member
Junior Member
Posts: 20
Joined: 2020-02-08, 09:04 UTC

Re: Creat folder and move files to folder

Post by *TotalRobbie »

Thanks for helping
User avatar
petermad
Power Member
Power Member
Posts: 14787
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Creat folder and move files to folder

Post by *petermad »

2TotalRobbie
You can download this: https://madsenworld.dk/tcmd/button.zip and copy the text from the file inside the archive to your usercmd.ini file.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
TotalRobbie
Junior Member
Junior Member
Posts: 20
Joined: 2020-02-08, 09:04 UTC

Re: Creat folder and move files to folder

Post by *TotalRobbie »

I almost got it done.

I only see that it is now a copy action instead of a move

Do I something wrong???
User avatar
petermad
Power Member
Power Member
Posts: 14787
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Creat folder and move files to folder

Post by *petermad »

2TotalRobbie
I only see that it is now a copy action instead of a move
Oh - Sorry - the code for a move command is here: https://madsenworld.dk/tcmd/button2.zip
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
TotalRobbie
Junior Member
Junior Member
Posts: 20
Joined: 2020-02-08, 09:04 UTC

Re: Creat folder and move files to folder

Post by *TotalRobbie »

it works i am very happy.


thank you very much
Post Reply