0

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?

jscott
  • 24,484
  • 8
  • 79
  • 100
  • 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 06 '11 at 22:31

1 Answers1

8

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"
John Gardeniers
  • 27,458
  • 12
  • 55
  • 109