Solved

creating multiple folders

Posted on 1998-12-18
9
218 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
  • 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
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.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 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