Buat FOLDER2x dr List di File berFormat TXT (ChatGPT)

To create multiple folders from a list in a .txt file using Command Prompt, you can follow these steps:

  1. Prepare your .txt file: Ensure your .txt file contains the names of the folders you want to create, with each folder name on a new line. For example:

    Folder1
    Folder2
    Folder3
    
  2. Open Command Prompt:

    • Press Win + R, type cmd, and hit Enter.
  3. 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
    
  4. Use the for /f command to create folders:

    • If your .txt file is called folders.txt and it's located in C:\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 .txt file (folders.txt) and creates a folder with that name.

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 .txt file.

Note:

  • If you want to run this in a batch file, replace %i with %%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
D:\# BLOG FILES #\SUPPORTING BACK UP FILES\FOLDERS.TXT

No comments: