Solved

creating multiple folders

Posted on 1998-12-18
9
219 Views
Last Modified: 2011-09-20
Is there a way to create a folder with the same name under multiple subdirectories with one set of commands. I do not want to do it manually, it would take forever. This is on a netware 4.11 directory tree using Explorer.
Or perhaps there is a dos command.
0
Comment
Question by:jlmacek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
9 Comments
 

Author Comment

by:jlmacek
ID: 1594471
Edited text of question
0
 

Expert Comment

by:demarb
ID: 1594472
To my knowledge no command exists in dos or in windows. I myself would write a simple program to do it for me if it is for a large number of directories.
0
 
LVL 4

Expert Comment

by:saar2
ID: 1594473
I tried to create such program for you but I didn't success.

Let me guess something...
Do you want to create under each user's home directory a new subdirectory?

If this is the situation, then do it from the login script.

After you map a drive (lets say T:_ to the home directory, run a batch file which will look like:

If Not Exist T:\Newdir\Null Md T:\Newdir

You might success doing this from the login script instead from a batch file.


Saar Carmi,
saar@bigfoot.com
ICQ#  3233305

0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 4

Expert Comment

by:saar2
ID: 1594474
I am very sorry.

I did not mean to submit my comment as an answer.

Please reject my answer.

Saar
0
 

Author Comment

by:jlmacek
ID: 1594475

Saar errantly made his an answer when he meant it for a comment.

what i have is a pool of 9 directories with about 25 subdirectories, i want to create a folder in each subdirectorie, the folder will have the same name in each subdirectory
thanks
0
 

Expert Comment

by:demarb
ID: 1594476
If no other solution presents itself, a program could be written for you to create the folders you want, we would just need the information about what the directory would be named, etc.
0
 
LVL 4

Accepted Solution

by:
Zombite earned 100 total points
ID: 1594477
Dos prompt
Go to the top of the dir tree where you want to start.
Type dir *. /s > c:\list.txt

Will produce a file with directory names such as

Directory of G:\INFOSERV\Utils\NETTEST

              <DIR>                        .
             <DIR>                        ..
         0 file(s)              0 bytes

Directory of G:\INFOSERV\Utils\NETSAMP

              <DIR>                        .
             <DIR>                        ..
         0 file(s)              0 bytes


OPEN IN WORDPAD
Do a cleanup to leave directories that you want to create the new sub-directories in. ( Can be done reasonably quickly)


EG

Directory of G:\INFOSERV\Utils\NETSAMP
Directory of G:\INFOSERV\Utils\NETTEST

Replace Directory of  with mkdir command
add directory name to the end

MKDIR G:\INFOSERV\Utils\NETSAMP\newstuff
MKDIR G:\INFOSERV\Utils\NETTEST\newstuff

rename as batch file and run with correct rights to create
directories.

If particular rights need to be created, use same batch file and use flag command as required.


0
 

Expert Comment

by:anadrash
ID: 1594478
In cases like this I certainly propose a DOS batch file.

Step 1
------

First, from the parent of 9 dirs, issue the command:

dir /s/ad > create.bat

(the /ad option will show only the directories).

In case the 9 directories are not the only ones under
their parent directory you must use this command:

for %d in (dir1 dir2 dir3 ... dir9) do dir dir%d /s/ad >> create.bat
(this will append the "create.bat" with the subdirs
of each of the 9 directories.

Step 2
------

You must edit the file "create.bat" with a text editor.
This file will originally contain lines with the "tree"
of all subdirectories. You will add the command "md "
at the beginning of each line and the subdir "\name"
at the end of each line.
If you use Norton Editor you can issue a Replace command
where you will replace the "End of Line" with
"\name"+"End of Line"+"md " and it will do the job at once.

Step 3
------

If you do this job often you can automate it under conditions.
Are the 9 subdirs always the same? Are the 25 subdirs always
the same or changed rarely? In a case like this you can
create a permanent or rarely changed batch file where the
subdir name is a parameter and the job is done with a command
like:

create name

Thanks,
Yiannis

0
 

Expert Comment

by:anadrash
ID: 1594479
This is a comment on my comment.

I forgot the option /b which must be included after the dir
command together with the /s/ad options. The lines would be:

dir /s/ad/b > create.bat

and

for %d in (dir1 dir2 dir3 ... dir9) do dir dir%d /s/ad/b >> create.bat

This option will give you the directory names in bare format.
(no heading information or summary, just the names).

Thanks again,

Yiannis

0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
A big percent of today’s marketing activity is performed through the online environment. The marketing strategies that have existed a decade ago no longer relate to what’s happening today. We’re currently facing a revolutionary era, called the digit…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question