Scripting question. Dang, it should be easier than this. I have a file with a list of names. I'd like to turn those names into folders. Whenever I try the FOR loop, all I get is the name of the file I want to read from being created as a folder, not the contents of the file being turned into folders. Just want to mkdir for each item in the list.
|
One way is to open the list of names in word and do copy and replace. Replace ^p with ^pmkdir this will replace all carraige returns (^p) with a carriage return and the mkdir command. Then save it as a bat and run it. There's def a cleaner way to do this if its going to be used over and over, but this is quick quick. | |||||
feedback
|
|
Here you go:
This makes a directory under the current directory for each line in a file called "listfiles" in the current directory. If you saved the file as a .txt file, make sure to reflect that in the command.
| ||||
|
feedback
|
|
The code | |||
|
feedback
|
|
Assuming list of names are stored in a text file called dirlist.txt, then the command should be like this: for /F "tokens=1 delims= " %i in (dirlist.txt) do md %i | |||
|
feedback
|