Windows 10

Batch File To Create Folders From a List

In this tutorial, we are going to see how to create folders from a list by using For Loop. The batch file contains a series of DOS (Disk Operating System) instructions. It allows triggering the execution of commands found in this file.
 

Batch File To Create Folders From a List

The following example create 6 folders A, B, C, D, E, F from a list called “folders”:
 

 

@echo off

set "folders= A"                 
set "folders=%folders% B"      
set "folders=%folders% C"
set "folders=%folders% D"
set "folders=%folders% E"      
set "folders=%folders% F"

for %%i in (%folders%) do md %%i

Output:

 

Leave a Reply

Your email address will not be published. Required fields are marked *