mkDir: How to create button to make a folder ?
Moderators: Hacker, petermad, Stefan2, white
mkDir: How to create button to make a folder ?
Hi, I have a question. How to create shortcut button to make a folder with defined name?.
For example: I want to create new folder (pressing f7) and automatically in new name of folder I want - <[Y]-[M]-[D]\folder_A\..\Folder_B\
How to do it so you don't have to type the name manually.
For example: I want to create new folder (pressing f7) and automatically in new name of folder I want - <[Y]-[M]-[D]\folder_A\..\Folder_B\
How to do it so you don't have to type the name manually.
Re: mkDir
There is a cm_MkDir command but I don't think it supports parameters (if I'm wrong no doubt others will post a correct solution)
I would use the mkdir dos command combined with the %$DATE% variable that was recently introduced in v11
Right click on a button bar, or create a start menu item, or a user command (edit usercmd.ini manually), command:
Or copy these lines and "paste" it on a free spot on you button bar
I would use the mkdir dos command combined with the %$DATE% variable that was recently introduced in v11
Right click on a button bar, or create a start menu item, or a user command (edit usercmd.ini manually), command:
Code: Select all
%comspec% /c mkdir %$DATE:Y-M-D%\folder_A\ %$DATE:Y-M-D%\Folder_B\
Code: Select all
TOTALCMD#BAR#DATA
%comspec% /c mkdir %$DATE:Y-M-D%\folder_A\ %$DATE:Y-M-D%\Folder_B\
wcmicons.dll,29
Create Dirs
-1
Re: mkDir
My vote goes for the cm_MkDir command to have customizable parameters of the same level as, e.g., the cm_Edit command does.hi5 wrote: 2023-10-03, 21:13 UTC There is a cm_MkDir command but I don't think it supports parameters...
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Re: mkDir: How to create button to make a folder ?
Thanks !
worked like a charm for me.
Is it possible to also select or go into the newly created directory ?
I tried
but it looks like cm_GotoDir doesn't take any parameters either.
The command creates a directory called "cm_GotoDir" instead of selecting or going into the date directory
Code: Select all
%comspec% /c mkdir %$DATE:yMD%
Is it possible to also select or go into the newly created directory ?
I tried
Code: Select all
%comspec% /c mkdir %$DATE:yMD%, cm_GotoDir %$DATE:yMD%
The command creates a directory called "cm_GotoDir" instead of selecting or going into the date directory

Using Total Commander for more than a quarter of a century.
Re: mkDir: How to create button to make a folder ?
Hi and welcome.
For this idea you have first to create a "user defined command" in usercmd.ini for the MKDIR command.
Next you could try this command in an button
em_MkDir_yMD,cm_wait 500,cm_SrcByDateTime,cm_GoToFirstEntry,cm_Return ,cm_wait 500,cm_SrcByName
See text file TOTALCMD.inc in TC folder.
For this idea you have first to create a "user defined command" in usercmd.ini for the MKDIR command.
Next you could try this command in an button
em_MkDir_yMD,cm_wait 500,cm_SrcByDateTime,cm_GoToFirstEntry,cm_Return ,cm_wait 500,cm_SrcByName
See text file TOTALCMD.inc in TC folder.
Re: mkDir: How to create button to make a folder ?
It seems more obvious to use command:
And define em_MkDir_yMD as
Code: Select all
em_MkDir_yMD,cm_wait 500,cd "%$DATE:yMD%"
Code: Select all
%comspec% /c mkdir %$DATE:yMD%
Re: mkDir: How to create button to make a folder ?
If the folder is not empty:
Code: Select all
cm_GoToNext,cm_Copy /GT="%$DATE:yMD%\"W="|* *\",cm_Wait 50,cd "%$DATE:yMD%"