creating a new folder in multiple subfolders

  • Thread starter Thread starter Miles
  • Start date Start date
M

Miles

I basically need to create a subfolder in around 450 subfolders, within 8
folders. Is there any way of doing this or will I have to do it manually?

Thanks.
 
The answer is yes, you can create a simple batch file that will do a simple
looping and keep creating as many folders as you need. You will have to use
DOS mkdir, cd, cd.. and some other commands. It is programming of sorts,
albeit simple. It does require some debugging. You may find extensive
resources on the web. Just google for batch files.
 
I've got it sorted now, thanks for your help.
In the end I did a dir c:\***\*** > test.txt to get the list, took out the
rubbish and based my batch file around that.

Thanks again
 
I am happy you did it. I also get angry when screwed up synaptic
transmissions prowl this forum to prey on unsophisticated users to make a
few bucks selling their sh*t. They use every chance, no shame displayed.

You did it in record time. It would have taken perhaps 5 times as long for
me. I do not do batches very often. Every time I have to refresh basics.
 
Gee, doesnt' anyone do dos programming any more? All you do is


for /r "c:\thedirectory" %x in (newdirectory) do
echo "mkdir %x">>makedirs.bat

call makedirs.bat

rem interesting things will happen if you try "do mkdir %x"
 
the wharf rat said:
Gee, doesnt' anyone do dos programming any more? All you do is


for /r "c:\thedirectory" %x in (newdirectory) do
echo "mkdir %x">>makedirs.bat

call makedirs.bat

rem interesting things will happen if you try "do mkdir %x"


I cannot visualise how the OP wants the folders. What do you mean by the
last bit?
rem interesting things will happen if you try "do mkdir %x"

There is no 'do' command?

ss.
 
What do you mean by the last bit?

If you do something like find . -type d -exec mkdir {}/foo \;
on unix you get 1 foo directory per each existing directory because
unix commands read the whole directory then iterate over the members.
But if you do something like for /r %x in (blah) do mkdir %x you get
..\blah\blah\blah\blah ad infinitum until the path gets too long and
crashes the script. That's because the dos for /r reads each directory
entry, performs the operation and then moves to the next, eventually getting
to the last one added which is \blah... See what happens?
 
unix commands read the whole directory then iterate over the members.

BTW, that's not defined as required anywhere, it's simply
historical behavior :-) so one day it'll bite someone in the butt too.
 
Yep, this is the sad part, shall I say a downside or untoward side effect of
progress. People forget simple, useful things when more advanced techniques
come along. Your doc does not take you pulse anymore, all he does is to look
into his monitor, not into your face. Docs of yesterday could get quite a
few good tips from talking to their patients.
 
Back
Top