for /F "tokens=*" %* in (Test.txt) do md ".\%*" & cd "%*" & md "Something1" & md "Something2" & cd ".."
The DOS command will pull names from text file and create a named folder then two subfolders.
Apple-Something1-Something2
But when I put it into a batch file as follows:
@ECHO OFF
@for /F "tokens=*" %* in (Test.txt) do md ".\%*" & cd "%*" & md "Something1" & md "Something2" & cd ".."
ECHO Done
PAUSE
Then run it from Windows GUI a sreen pops up, closes, and does nothing. Even if I create a batch with the working DOS command it does nothing. What am I missing?
Thank you.
In batch files, you need to double the ‘%’ in the
forvariable. Don’t ask me why. 🙂