Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

creating multiple folders

Posted on 1998-12-18
9
Medium Priority
?
221 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
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 
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 200 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

688 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