To create multiple folders from a list in a .txt file using Command Prompt, you can follow these steps:
-
Prepare your
.txtfile: Ensure your.txtfile contains the names of the folders you want to create, with each folder name on a new line. For example:Folder1 Folder2 Folder3 -
Open Command Prompt:
- Press
Win + R, typecmd, and hitEnter.
- Press
-
Navigate to the directory where you want to create the folders: For example, if you want to create the folders in
C:\Users\YourName\Documents, type:cd C:\Users\YourName\Documents -
Use the
for /fcommand to create folders:- If your
.txtfile is calledfolders.txtand it's located inC:\path\to\your\file, you can use the following command:
for /f "delims=" %i in (C:\path\to\your\file\folders.txt) do mkdir "%i"This command reads each line from the
.txtfile (folders.txt) and creates a folder with that name. - If your
Explanation:
for /f "delims=" %i in (path)loops through each line in the file.mkdir "%i"creates a folder using the value (%i) from the current line of the.txtfile.
Note:
- If you want to run this in a batch file, replace
%iwith%%i.
For example, in a .bat file:
for /f "delims=" %%i in (C:\path\to\your\file\folders.txt) do mkdir "%%i"
CONTOH HASIL DI GW:
D:\# BLOG FILES #\SUPPORTING BACK UP FILES\FOLDERS.TXT

Comments