Create folders with name which taken from txt file in another directory

Viewed 42

I have a problem with solving this task: Create folders (with for loop obviously) in which names are taken from txt file in another folder(need to use call command) if the folder has not been created(some names have spaces) write down the name of the file which has not been created in another txt file.

Here i have for loop to create folders with custom names from txt file:

for /F %i in (file.txt) do md %i

I would be very thankful if somebody could help me in making call command for txt and if statement :)

1 Answers
for /f "delims== tokens=1,2" %%G in (list.txt) do (
    md "%%G"
    if errorlevel 1 (echo Error creating folder : %%G >> Error.txt)
)
Related