What is the easy way to create folders like d:\a\b\c\d\

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
dindog
Senior Member
Senior Member
Posts: 316
Joined: 2010-10-18, 07:41 UTC

What is the easy way to create folders like d:\a\b\c\d\

Post by *dindog »

it's a deep folders set... I don't want to
1. new folder "a"
2. cd a
3. mkdir b
4. cd b
... :shock:

I want something like super_mkdir a\b\c\d\
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

1.) Press F7
2.) type: a\b\c\d
3.) click [OK]





You can also use the TC command line: md a\b\c\d <enter>

 
Last edited by Stefan2 on 2015-08-10, 17:11 UTC, edited 1 time in total.
User avatar
Dalai
Power Member
Power Member
Posts: 10023
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Apparently, you didn't just try to create the directories like you want them to be created. You can create several directory levels just like you'd think it'd work: F7, type in a\b\c\d and press Enter, and TC will create the structure like this:

Code: Select all

a
|-b
  |-c
    |-d
If you want them to be on the same level, use the pipe symbol (|) to separate them, like this: F7, type in a|b|c|d, and TC will create the structure:

Code: Select all

|-a
|-b
|-c
|-d
And, of course, these two features can be combined.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
kevo
Junior Member
Junior Member
Posts: 8
Joined: 2015-08-07, 21:03 UTC

Post by *kevo »

Related to this, is it possible to create subdirectories per all new folders?

So as to create

Code: Select all

a
|-x
|-y
b
|-x
|-y
c
|-x
|-y
without doing it like

Code: Select all

a/x|a/y|b/x|b/y|c/x|c/y
User avatar
Dalai
Power Member
Power Member
Posts: 10023
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2kevo
Well, not really. You can create "a\b\c\d" and after that enter every directory and create "x|y" there. You can use the history in the F7 dialog to make the creation a little easier, i.e. press F7, cursor down and Enter after the first pair of "x|y" was created.

Or you can use some script, or maybe even the extDir tool can help here (don't know).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
tcuser2018
Junior Member
Junior Member
Posts: 5
Joined: 2018-03-25, 21:33 UTC

Re: What is the easy way to create folders like d:\a\b\c\d\

Post by *tcuser2018 »

I am looking for a way to create a keyboard shortcut (and toolbar button if possible) via a script to do this as well.
Much like described where I need to create a set of folders and subfolders with the same name each time.

Code: Select all

a
|-x
|-y
b
|-x
|-y
c
|-x
|-y
I looked into the extDir tool but it isn't clear how to use the Templates feature to create more than one directory and the tool is not maintained anymore.

Any help, appreciated!
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: What is the easy way to create folders like d:\a\b\c\d\

Post by *Stefan2 »

tcuser2018 wrote: 2022-03-15, 01:14 UTC I am looking for a way to create a keyboard shortcut (and toolbar button if possible) via a script to do this as well.
Much like described where I need to create a set of folders and subfolders with the same name each time.

Code: Select all

a
|-x
|-y
b
|-x
|-y
c
|-x
|-y

- Create f.ex. a DOS Batch file for that (or nowadays Powershell, but here a batch is enough and more simple to write)
- Create a button to call that batch
- Or create a UserDefinedCommand to us as button command too and for to assign a keyboard shortcut for.


- Create a text file in TCs folder.
- Edit and paste in the batch code.
- Save and rename to CMD extension.
- Drag&Drop the file to TCs buttonbar.
- Right click that button >> Change...
>>>> remove the path from "Start path:" (leave empty to let TC always use the current directory)
- Go to a folder and click that new button.


C:\Totalcmd\MyCreateFolders.cmd

Code: Select all

@ECHO OFF
REM Create new folders in current active folder
REM Found at https://ghisler.ch/board/viewtopic.php?p=410914#p410914
MD a\x
MD a\y
MD b\x
MD b\y
MD C\x & MD c\y & MD c\z

ECHO Well we have finished.
PAUSE


Need more help?



 
User avatar
nsp
Power Member
Power Member
Posts: 1950
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: What is the easy way to create folders like d:\a\b\c\d\

Post by *nsp »

The best for this task is to create a template archive zip or 7z. From your button just extract the zip with empty folder to current directory.Adapt for your needs:

Code: Select all

TOTALCMD#BAR#DATA
7z
x C:\temp\template01.7z -o"%P"
%commander_path%\WCMICON2.DLL,1
Create folders (template01)


-1
TC is now supporting multiple expression like :

Code: Select all

 a\x|a\y|b\x|b\y|c\x|c\y
you can keep it in an enhanced clipboard manager and just paste it or reuse from history...
Post Reply