how can i create multiple directories?
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 3
- Joined: 2003-12-22, 20:34 UTC
how can i create multiple directories?
Hi all,
I'm a new user to TC and I think it's an extremely useful program for arranging ones directories and files.
I have one question, how can I create multiple directories with one command?
I face this problem when I have some hundred files that I want to move to a different drive into mutiple directories. The solution I use currently is to open a command prompt into the target directory using TC and do a manual "md dir1,dir2,dir3,...etc."
I would like to use the built-in directory creator, but it doesn't recognize commas, semicolons, or anything as a separator for dir names.
Any help would be appreciated!
I'm a new user to TC and I think it's an extremely useful program for arranging ones directories and files.
I have one question, how can I create multiple directories with one command?
I face this problem when I have some hundred files that I want to move to a different drive into mutiple directories. The solution I use currently is to open a command prompt into the target directory using TC and do a manual "md dir1,dir2,dir3,...etc."
I would like to use the built-in directory creator, but it doesn't recognize commas, semicolons, or anything as a separator for dir names.
Any help would be appreciated!
Re: how can i create multiple directories?
Hello!Cryptonium wrote:Hi all,
I'm a new user to TC and I think it's an extremely useful program for arranging ones directories and files.
I have one question, how can I create multiple directories with one command?
I face this problem when I have some hundred files that I want to move to a different drive into mutiple directories. The solution I use currently is to open a command prompt into the target directory using TC and do a manual "md dir1,dir2,dir3,...etc."
I would like to use the built-in directory creator, but it doesn't recognize commas, semicolons, or anything as a separator for dir names.
Any help would be appreciated!
Welcome on board!
I think that the MD fonction in TC works rather as:
MD x:\dir\sub-dir\sub-sub-dir and so on... I tested, it's right.
In the Help, you can find a similar explanation:
"...You can now also create several subdirectories in one operation. Just separate the subdrectories with a backslash, e.g. directory1\directory2\directory3\. ..."
¤ I don't think that you could create several directories in a single operation.... Maybe with a plugin?
¤ However, since it's so long and irritating to create a lot of dirs. i.e. when installing in a new HD, you could write a batch file to create the most needed dirs. Name it: <anything.bat>. Place it in <windows> dir. Then, you launch it from a DOS / command-line box. Something like:
@echo off
md c:\My-images
md e:\My-music
md e:\My-movies
...... and so on...
exit
Then, you'll create sub-dirs in these dirs with TC easily!
Hoping that answers to your question,
Friendly regards,
Claude
Clo
#31505 Traducteur Français de T•C French translator Aide en Français Tutoriels Français English Tutorials
-
- Junior Member
- Posts: 3
- Joined: 2003-12-22, 20:34 UTC
Thanks for your help.
I use TC most of the time to arrange my downloaded comics collection from usenet. Since these are mostly posted as single pages, I need to collect them into directories that contain complete issues.
I created a small batch file that can create a sequential set of directories (e.g. batman-001, batman-002,..etc) and it would be great if I can find a way to pass it the 3 parameters necessary to create the required dirs.
My script is one single line:
If I can pass it the first number (0) and the last one (6), it can create the set of dir batman-001,...,batman-006.
I'm complete newbie in DOS scripting but I hope I can integrate this somehow in TC
I use TC most of the time to arrange my downloaded comics collection from usenet. Since these are mostly posted as single pages, I need to collect them into directories that contain complete issues.
I created a small batch file that can create a sequential set of directories (e.g. batman-001, batman-002,..etc) and it would be great if I can find a way to pass it the 3 parameters necessary to create the required dirs.
My script is one single line:
Code: Select all
for /L %%N in (0,1,6) do @mkdir batman-0%%N
I'm complete newbie in DOS scripting but I hope I can integrate this somehow in TC
-
- Junior Member
- Posts: 3
- Joined: 2003-12-22, 20:34 UTC
I think I solved my problem and I want to share it with the good people in this forum.
I created a DOS batch file that takes 4 parameters:
1. Destination dir
2. Start of the dir name
3. Start number
4. End number
Here's my batch file:
The I created a button in TC with the following parameters:
? %p %O
The first parameter just causes a dialog box to be shown with the 2nd and 3rd parameters and allows the user to add the starting and ending numbers of the sequence.
The second parameter add the current Source dir in TC, and the last one adds the name of the file currently selected without its extension.
The way it would work is that after I move my files to one directory, I can select one of the files and click on my button and then just fill the start and end numbers and all the required dirs will be created.
I hope this will be useful to people who use TC to sort their comics collection!
I created a DOS batch file that takes 4 parameters:
1. Destination dir
2. Start of the dir name
3. Start number
4. End number
Here's my batch file:
Code: Select all
:: Help
:: ajdir <target dir> <name> <start_num> <end_num>
for /L %%N in (%3,1,%4) do @mkdir %1\%2-0%%N
? %p %O
The first parameter just causes a dialog box to be shown with the 2nd and 3rd parameters and allows the user to add the starting and ending numbers of the sequence.
The second parameter add the current Source dir in TC, and the last one adds the name of the file currently selected without its extension.
The way it would work is that after I move my files to one directory, I can select one of the files and click on my button and then just fill the start and end numbers and all the required dirs will be created.
I hope this will be useful to people who use TC to sort their comics collection!
Not expert too...
Cryptonium
Unfortunately, I'm not an expert at DOS scripting... I used DOS (6.0-->
6.2) a lot, but wrote only so simple *.bat files (still useful!), the most complex were boot-menus... Now, this old PC is out of duty...
¤ You could try your sequence-line from the TC command-line (must be enabled in the Options >>Configuration >>Layout -default page when open-)
I hope that'll work properly!
Or else, you could use my old simplistic system... Remember: DOS names are 8.3! Or else, you'll get ~ in the name... Awful tildes!
Friendly regards,
Clo
Hi again!If I can pass it the first number (0) and the last one (6), it can create the set of dir batman-001,...,batman-006.
I'm complete newbie in DOS scripting but I hope I can integrate this somehow in TC
Unfortunately, I'm not an expert at DOS scripting... I used DOS (6.0-->
6.2) a lot, but wrote only so simple *.bat files (still useful!), the most complex were boot-menus... Now, this old PC is out of duty...
¤ You could try your sequence-line from the TC command-line (must be enabled in the Options >>Configuration >>Layout -default page when open-)
I hope that'll work properly!
Or else, you could use my old simplistic system... Remember: DOS names are 8.3! Or else, you'll get ~ in the name... Awful tildes!
Friendly regards,
Clo
#31505 Traducteur Français de T•C French translator Aide en Français Tutoriels Français English Tutorials
- pdavit
- Power Member
- Posts: 1529
- Joined: 2003-02-05, 21:41 UTC
- Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
- Contact:
From TC's help: "You can now also create several subdirectories in one operation. Just separate the subdrectories with a backslash, e.g. directory1\directory2\directory3."
Of course this isn't completely an automated process!
Now, for multiple file distribution on several different destinations the wish has already been made and now with the new tabbed system Christian has promised to consider it.
Of course this isn't completely an automated process!
Now, for multiple file distribution on several different destinations the wish has already been made and now with the new tabbed system Christian has promised to consider it.
"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!
Christian Ghisler Rules!!!
An alternative way:
* Create a folder somewhere with some new empty folders with extensions .01 , .02 , etc. Keep this folder as a basis to create other empty folders.
* Select the empty folders you like (e.g. NewFolder.02, NewFolder.05, NewFolder.07)
* Copy these empty folders to the desired target folder and optionally change the names of the folders in the process.
Image: http://img182.exs.cx/img182/6447/tcnewfoldersexample00000000001.png
* Create a folder somewhere with some new empty folders with extensions .01 , .02 , etc. Keep this folder as a basis to create other empty folders.
* Select the empty folders you like (e.g. NewFolder.02, NewFolder.05, NewFolder.07)
* Copy these empty folders to the desired target folder and optionally change the names of the folders in the process.
Code: Select all
D:\TargetFolder\NewName.*
Last edited by white on 2005-02-01, 19:24 UTC, edited 1 time in total.
- Boofo
- Power Member
- Posts: 1431
- Joined: 2003-02-11, 00:29 UTC
- Location: Des Moines, IA (USA)
- Contact:
Would the asterik just copy the numbers then and nothing else in that spot?white wrote:An alternative way:
* Create a folder somewhere with some new empty folders with extensions .01 , .02 , etc. Keep this folder as a basis to create other empty folders.
* Select the empty folders you like (e.g. NewFolder.02, NewFolder.05, NewFolder.07)
* Copy these empty folders to the desired target folder and optionally change the names of the folders in the process.Image: http://home.hccnet.nl/web.site/example/TC/New%20Folders/example.pngCode: Select all
D:\TargetFolder\NewName.*
- DarkKnight
- Junior Member
- Posts: 35
- Joined: 2004-03-29, 19:53 UTC
Did you see the great solution in http://ghisler.ch/board/viewtopic.php?p=31623#31623 using 1\..\2\..\3\..\4 to create 4 dirs at once?
- Vochomurka
- Power Member
- Posts: 814
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
http://ppro.totalcmd.net/Scripts/BatchMD.htm
Second time today I am posting this link
Second time today I am posting this link
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
This is how I would do it:
If you want to create multiple directories, you can separate them with pipe, i.e. press F7 and type a|b|c - will create directories a, b and c.
If you want to create multiple directories too often, you can do this:
1. Create text file accessible via button bar with contents like a|b|c|b|d|e|f|g|h|....
2. Each time you need to create those sequential dirs, just open this file and paste its contents (or part) to F7 dialog
3. Then press Ctrl-(Num+) to select all and Ctrl-M to rename all those dirs as you wish incl numbers...
Obviously, this is going to work only when you are creating these new dirs in new empty directory. With little effort however you can handle also not empty dir
ado
If you want to create multiple directories, you can separate them with pipe, i.e. press F7 and type a|b|c - will create directories a, b and c.
If you want to create multiple directories too often, you can do this:
1. Create text file accessible via button bar with contents like a|b|c|b|d|e|f|g|h|....
2. Each time you need to create those sequential dirs, just open this file and paste its contents (or part) to F7 dialog
3. Then press Ctrl-(Num+) to select all and Ctrl-M to rename all those dirs as you wish incl numbers...
Obviously, this is going to work only when you are creating these new dirs in new empty directory. With little effort however you can handle also not empty dir
ado
- Vochomurka
- Power Member
- Posts: 814
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
In this case I would suggest two batch files:
Way 1:Of course, the list in parentheses (DirOne DirTwo...) can be made quite long (up to 200 chars approximately, if I am not wrong )
Way 2:
This file can be made as long as you wish.
Way 1:
Code: Select all
for %%a in (DirOne DirTwo DirThree) do md c:\mypath\%%a
Way 2:
Code: Select all
md c:\mypath\DirOne
md c:\mypath\DirTwo
md c:\mypath\DirThree
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
Batch create directories
Hello,
Can someone please build a command for me that:
- scans a directory for files (1 level depth)
- creates a sub-directory bearing the name of that file after it has removed the extension
- move that same file to its directory
- an so on to the next file
Thanks
Can someone please build a command for me that:
- scans a directory for files (1 level depth)
- creates a sub-directory bearing the name of that file after it has removed the extension
- move that same file to its directory
- an so on to the next file
Thanks