Mass Folder Creation - mkdir issues.. Help??

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
outandabout
Posts: 3
Joined: 13 Jan 2010 07:34

Mass Folder Creation - mkdir issues.. Help??

#1 Post by outandabout » 13 Jan 2010 08:08

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

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 13 Jan 2010 11:55

for /f "delims=" %%1 in (way2.txt) do md "%%~1"

outandabout
Posts: 3
Joined: 13 Jan 2010 07:34

#3 Post by outandabout » 13 Jan 2010 13:42

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

outandabout
Posts: 3
Joined: 13 Jan 2010 07:34

#4 Post by outandabout » 14 Jan 2010 06:41

THIS TOPIC IS OFFICIALLY CLOSED DUE TO THE FACT THAT A SOLUTION WAS FOUND

Post Reply