Solved

creating multiple folders

Posted on 1998-12-18
9
208 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
Comment Utility
Edited text of question
0
 

Expert Comment

by:demarb
Comment Utility
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
Comment Utility
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
 
LVL 4

Expert Comment

by:saar2
Comment Utility
I am very sorry.

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

Please reject my answer.

Saar
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:jlmacek
Comment Utility

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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
A procedure for exporting installed hotfix details of remote computers using powershell
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now