قالب وردپرس درنا توس
Home / Tips and Tricks / Creating multiple folders at once in Windows 10

Creating multiple folders at once in Windows 10



Create multiple folders at once in Windows 10

Creating new folders and subfolders manually is time consuming if you want to organize and manage files on your Windows 10 PC. Instead, you can create multiple folders at once using the command prompt, PowerShell, or a batch file.

These apps save you the task of right-clicking> New Folder or using Ctrl + Shift + N to create a new folder, which is annoying when you need to create several. However, there are ways you can prevent that.

Create multiple folders with the command prompt

You may want to check out the different ways to open Command Prompt with administrator privileges.

Click the Windows Start button on the taskbar and type “cmd”

; in the Windows search bar to open the command prompt. Then choose “Command Prompt” from the search results.

Open Command Prompt from Windows Search

You can change directories in the command prompt using the cd command and go to the directory where you want to create directories.

Change directories in the command prompt

Let’s start small and say you want to create seven folders for each day in a week. So you can use the following command:

md sunday monday tuesday wednesday thursday friday saturday

Command multiple folders in the CMD

Replace the folder names after the md command with actual.

After that, you can close the command prompt and open the destination in Windows Explorer to check the newly created folders.

New folders with CMD in Windows Explorer

Tip: You can automatically enter consecutive names using Excel on your computer if you need to create hundreds of folders

RELATED: 10 Useful Windows Commands You Should Know

Create multiple folders with PowerShell

Another method that allows you to create folders in bulk is to use Windows PowerShell. We will use the same folder names as mentioned above. You can take the help of a plain text editor to collect the words.

Click the Windows Start button in the taskbar, type “PowerShell” in Windows Search to open PowerShell, and you will see “PowerShell” in the search results. Right click on it and choose the option “Run as administrator”.

Search PowerShell in Windows Search

The PowerShell window opens by default with you in the user folder. Suppose you want to create new folders in the “Documents” folder. You can do that with the cd order. So we’ll use this command:

cd Documents

Change the directory to PowerShell

To create folders in bulk, you must first collect the file names and then run a specific command in the PowerShell window. Let’s say you want to create folders for every day in a week. So you can use this command:

"sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"  | %{New-Item -Name "$_" -ItemType "Directory"}

PowerShell command to create multiple directories

Replace folder names before the pipe by typing them in quotes and separating them with a comma.

After running the command, you can close the PowerShell and open Windows Explorer to find the “Documents” or the destination you used to create new folders.

New multiple folders created with PowerShell

RELATED: Geek School: Learn How to Automate Windows with PowerShell

Create multiple folders and subfolders with a batch script

Using the command prompt is cumbersome if you need to add a folder structure to create subfolders. Then the command would look confusing:

md folder1subfolder1actualfolder1 folder2subfolder2actualfolder2

One mistake can disrupt the actual folder structure and you can always rename folders in different ways. However, batch files can avoid this to quickly run a simple command.

Type the folder and subfolder names with a folder structure in a plain text file in an app such as Notepad. For April, suppose you want to create folders for the weeks and days in each week. Type a correct folder structure for each name, leaving space between:

Type folder names and structure in Notepad

Note: If your folder names contain two words or special characters, put each folder name, including its subfolders, in quotation marks.

Then type @echo off at the top and press Enter to create a space. Then add md before each folder structure if it is on a separate line, or just once if there is space between folder structures.

Add batch file values ​​in Notepad

Now save the file with a name you like and replace the file extension .txt with the extension .bat.

Save as .bat file in Windows Explorer

Copy this batch file when you want to create multiple folders at the same time. Double click to run it.

This way you can create multiple folders at the same time and save time.




Source link