Page 1 of 1

Mass Folder Creation - mkdir issues.. Help??

Posted: 13 Jan 2010 08:08
by outandabout
Hi everyone. Im new to this forum & scripting altogether. If possible i would praise for a little help regarding a mkdir issue i have.
Searching through the net i found a way to create multiple folders using a .txt file as a reference.

01. The .txt file's structure is as follows:

PDF and rest
misc tools
internet browsers
blah blah blah.. around 250 folders

No quotes, no anything. Just the name of the folder i want.

02. The batch file's structure is as follows
As follows:

@echo off
for /f %%1 in (way2.txt) do mkdir %%1
pause

The batch runs without any trouble creating the folders where i want them with only one issue.
Folder names containing "spaces" between them get created up until the space.

For example:
PDF and rest: created as PDF
misc Tools: created as misc
internet browsers: created as internet

i have tried "quotes", [brackets], 'single quotes' in the .txt file to wrap up words but no luck.
Pls.. any suggestions..

I have found an alternative way for this for those who are interested, again with a batch, a little help from the registry and the following link:
http://pcworld.about.com/magazine/2402p122id123797.htm

Interesting way i think even though you might have to rewrite the root folder's name a couple of times but it is still faster than "right click-new folder...."


Anywayzzz thanks in advance. Hope there is a solution!!!

Posted: 13 Jan 2010 11:55
by avery_larry
for /f "delims=" %%1 in (way2.txt) do md "%%~1"

Posted: 13 Jan 2010 13:42
by outandabout
avery_larry wrote:for /f "delims=" %%1 in (way2.txt) do md "%%~1"


It worked like a charm.. Straight out of the box.
Much appreciated your response my friend!!
Thank you so much!!

Posted: 14 Jan 2010 06:41
by outandabout
THIS TOPIC IS OFFICIALLY CLOSED DUE TO THE FACT THAT A SOLUTION WAS FOUND