Create multiple directories
Moderators: Hacker, petermad, Stefan2, white
Create multiple directories
Hello
I would like to know if its possilbe to create multiple directories in one go with the Make Dir command. I know I can create several folder by using the | sign.
For ex Folder1|Folder2 will create two new folders.
But I would like to create a more advance folder structure like this:
Main folder
Subfolder A
Folder1
Folder2
Folder3
Subfolder B
Folder1
Folder2
Folder3
Does anybody know if its possible?
Thanks for any help
Regards
Hans
I would like to know if its possilbe to create multiple directories in one go with the Make Dir command. I know I can create several folder by using the | sign.
For ex Folder1|Folder2 will create two new folders.
But I would like to create a more advance folder structure like this:
Main folder
Subfolder A
Folder1
Folder2
Folder3
Subfolder B
Folder1
Folder2
Folder3
Does anybody know if its possible?
Thanks for any help
Regards
Hans
Try this:
Main folder\Subfolder A\Folder1|Main folder\Subfolder A\Folder2|Main folder\Subfolder A\Folder3|Main folder\Subfolder B\Folder1|Main folder\Subfolder B\Folder2|Main folder\Subfolder B\Folder3
PS: But I really don't understand, why it is necessary to create them all in one step...
Main folder\Subfolder A\Folder1|Main folder\Subfolder A\Folder2|Main folder\Subfolder A\Folder3|Main folder\Subfolder B\Folder1|Main folder\Subfolder B\Folder2|Main folder\Subfolder B\Folder3
PS: But I really don't understand, why it is necessary to create them all in one step...

Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 11.03 / Win10 x64
Using TC 11.03 / Win10 x64
Hi Flint
Thanks a lot for the lightning fast reply! It works perfect.
Yes, I guess a should explain why I need such an odd feature
I'm working at a publishing company with AD and editors. For each new publication (issue) we need a new folder structure were we can drop and move files to. Normally we have to create all this folders by hand. Sometimes they end up different than the last one because it hard to remember how it looks like. Or we reuse an old folder structure and delete all files that are in the folders.
So your command line helped a lot
Thanks a lot for the lightning fast reply! It works perfect.
Yes, I guess a should explain why I need such an odd feature

I'm working at a publishing company with AD and editors. For each new publication (issue) we need a new folder structure were we can drop and move files to. Normally we have to create all this folders by hand. Sometimes they end up different than the last one because it hard to remember how it looks like. Or we reuse an old folder structure and delete all files that are in the folders.
So your command line helped a lot

Haze
Hm... I have somewhat similar situation, and I just packed my empty folder structure into an archive, and when I need it I just unpack this archive.
Hm... I have somewhat similar situation, and I just packed my empty folder structure into an archive, and when I need it I just unpack this archive.

Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 11.03 / Win10 x64
Using TC 11.03 / Win10 x64
You may use a Batch file e.g.:
This batch creates 10 folders "folder1" to "folder10" with each three subfolders sub_a, Sub_b, Sub_c
sheepdog
Code: Select all
for /l %%i in (1,1,10) do (md folder%%i
cd folder%%i
md sub_a
md sub_b
md sub_c
cd ..)
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
- sqa_wizard
- Power Member
- Posts: 3897
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
2Haze: Even a workaround to copy an existing folderstructure only:
1. Select the folder at source panel you want to copy
2. Set the other panel to the destination for the copied structure
3. Switch back to the source panel
4. Press F5 to show copy dialog
5. At "only files of this type" enter a not existing filename such as "xxxyyyzzz.qqqqqq"
6. Start copy ...
This will copy all files matching the file mask (none in this case) and their folders => this means folders only.
Done
1. Select the folder at source panel you want to copy
2. Set the other panel to the destination for the copied structure
3. Switch back to the source panel
4. Press F5 to show copy dialog
5. At "only files of this type" enter a not existing filename such as "xxxyyyzzz.qqqqqq"
6. Start copy ...
This will copy all files matching the file mask (none in this case) and their folders => this means folders only.
Done

#5767 Personal license
- StickyNomad
- Power Member
- Posts: 1933
- Joined: 2004-01-10, 00:15 UTC
- Location: Germany
U can also DirCopy plugin for that but is so simple to put DIR, for example, in Type of files at F5 copy dialog.Haze wrote:Hi Flint
Thanks a lot for the lightning fast reply! It works perfect.
Yes, I guess a should explain why I need such an odd feature
I'm working at a publishing company with AD and editors. For each new publication (issue) we need a new folder structure were we can drop and move files to. Normally we have to create all this folders by hand. Sometimes they end up different than the last one because it hard to remember how it looks like. Or we reuse an old folder structure and delete all files that are in the folders.
So your command line helped a lot
Best wishes,
My Best Wishes,
Eugen
Eugen
HI sheepdog,Sheepdog wrote:You may use a Batch file e.g.:This batch creates 10 folders "folder1" to "folder10" with each three subfolders sub_a, Sub_b, Sub_cCode: Select all
for /l %%i in (1,1,10) do (md folder%%i cd folder%%i md sub_a md sub_b md sub_c cd ..)
sheepdog
I'm totally a noob with using a batch....
Where Can I type your batch code in TC and what does %, md and cd;;) means?
Registered user #150595
1. Press Shift+F4 in TC (what opens a new file in the configured editor)jordi.c wrote:HI sheepdog,Sheepdog wrote:You may use a Batch file e.g.:This batch creates 10 folders "folder1" to "folder10" with each three subfolders sub_a, Sub_b, Sub_cCode: Select all
for /l %%i in (1,1,10) do (md folder%%i cd folder%%i md sub_a md sub_b md sub_c cd ..)
sheepdog
I'm totally a noob with using a batch....
Where Can I type your batch code in TC and what does %, md and cd;;) means?
2. Inthe opening dialog insert a nem you like but with extension "CMD" or "BAT" e.g. Folder.cmd
3. Copy the text in the code box and paste it to the file.
4. Save the file.
5. Now you may doubleclick on the folder.cmd and in the current directory will ten folders with each three subfolders as described above.
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
OMFG!!
This works awesome
Can you give me a little bit explanation of the codes you are using in the cmd file?
for /l %%i in (1,1,10) do (md folder%%i
cd folder%%i
md sub_a
md sub_b
md sub_c
cd ..)
So I can make them on my own for the future with appropriate name and if necessary subfolder names
Best Wishes!!
This works awesome

Can you give me a little bit explanation of the codes you are using in the cmd file?
for /l %%i in (1,1,10) do (md folder%%i
cd folder%%i
md sub_a
md sub_b
md sub_c
cd ..)
So I can make them on my own for the future with appropriate name and if necessary subfolder names
Best Wishes!!
Registered user #150595
The "for" command is used to do operations with a set of files, folders or as in this case with counters. Just have a look in the Windows help for the word "for".
for /l => indicates, that you want to use a counter.
%%i => that defines a variable that contains the current value
in (1,1,10) defines that the counter starts by number 1, increases each time by 1 and ends up by 10
Use instead in (0,5,100) and you will see, how it works.
do introduces the commands that should be executed
( => indicates that you want to start a bunch of commands that do not end at the end of the line but at the closing bracket.
md Folder%%i => md is the DOS Command to make a directory Folder%%i is the name of the directory to make. the %%i will be substituted by the actual count of the loop. In this case by 1,2,3,4,5,6,7,8,9,10 or with the changed values (0,5,100) 0,5,10,15,20...100
Next line contains the next command
cd folder%%i => go into the folder that just has been created
md sub_a create a folder sub_a
md sub_b create a folder sub_b
md sub_c create a folder sub_c
cd .. go to the parent folder before the end of the set of commands.
) End of the command queue.
Now start the command queue with the next value.
If you don not use a batch file but type all those commands on the DOS prompt you have to use "%i" instead of "%%i". To use multiple commands on the DOS Prompt you could use the "&" to concatenate the commands
typed in one line on the DOS Prompt will create 21 folders with each 3 subfolders analogous to the batch file.
Hope that helps
sheepdog
for /l => indicates, that you want to use a counter.
%%i => that defines a variable that contains the current value
in (1,1,10) defines that the counter starts by number 1, increases each time by 1 and ends up by 10
Use instead in (0,5,100) and you will see, how it works.
do introduces the commands that should be executed
( => indicates that you want to start a bunch of commands that do not end at the end of the line but at the closing bracket.
md Folder%%i => md is the DOS Command to make a directory Folder%%i is the name of the directory to make. the %%i will be substituted by the actual count of the loop. In this case by 1,2,3,4,5,6,7,8,9,10 or with the changed values (0,5,100) 0,5,10,15,20...100
Next line contains the next command
cd folder%%i => go into the folder that just has been created
md sub_a create a folder sub_a
md sub_b create a folder sub_b
md sub_c create a folder sub_c
cd .. go to the parent folder before the end of the set of commands.
) End of the command queue.
Now start the command queue with the next value.
If you don not use a batch file but type all those commands on the DOS prompt you have to use "%i" instead of "%%i". To use multiple commands on the DOS Prompt you could use the "&" to concatenate the commands
Code: Select all
for /l %i in (0,5,100) do md folder%i &cd folder%i&md sub_a&md sub_b&md sub_c&cd ..
Hope that helps
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
Subdirectories
Hy!
I've got a similar problem: I do already have a directory structure with subdirectories for each year to archive documents. Now I do need to add the years coming. How do I achieve this?
structure:
client1 - documentation - 2003
client1 - documentation - 2004 ...
client2 - documentation - 2003...
Thanks in advance
Julian
I've got a similar problem: I do already have a directory structure with subdirectories for each year to archive documents. Now I do need to add the years coming. How do I achieve this?
structure:
client1 - documentation - 2003
client1 - documentation - 2004 ...
client2 - documentation - 2003...
Thanks in advance
Julian