Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am intested in creating a batch file that can read in a text file which has four variables: customer name, customer number, customer order, products orders. I am using:

FOR /F "delims=, tokens=1,2,3,4" %%f in (test.txt)do md g:\%%f\%%g\%%h\%%i

However, it does not seem to create the subdirectories correct.

Can any one help?

share|improve this question

closed as off topic by Zoredache, pauska, Scott Pack, Michael Hampton, Mark Henderson Dec 17 '12 at 0:00

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

5  
What output do you see if you replace the md with echo md? Are there spaces in the file name? Why not quote them path? –  Zoredache Oct 6 '11 at 22:31
add comment

1 Answer

I suspect you may have spaces in some of the parameters. Try this:

FOR /F "delims=, tokens=1,2,3,4" %%f in (test.txt) do md "g:\%%f\%%g\%%h\%%i"
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.