Your location:Tech News>OS>Windows 10 FAQ>Win10 Tips: Use PowerShell to create new folders in batches

Latest News

Win10 Tips: Use PowerShell to create new folders in batches



Introduced the use of Excel to help create new files and folders in batches. This time we will introduce a method to create new folders in batches with PowerShell which is better than the previous one. The method is simpler and can be done with one command.

The specific method is as follows:

1. Open PowerShell (no administrator rights required)

2. Switch to the desired folder The method is the same as the command prompt.

PS: The command is unfamiliar and you don’t need to switch it and you can just move it to the target location after the completion.

3. Use the following command to create a new one:

mkdir $(1..10 | %{IThome$_})

Note: In the above command 1..10 is the serial number of the batch folder. Indicates that the integers from 1 to 10 are used for naming. These numbers can be customized; the content inside the braces {} is the text before the serial number which shows IThome and these words can also be customized characters The back $_ refers to the previous number. As can be seen from the figure above it does not matter if the number is changed to 11..20.

Reminder from the editor of Pepsi: When copying and pasting the above commands some versions of PowerShell may have display problems. Make sure that the displayed text is correct before executing the command (move the cursor to the wrong character) The place may be corrected) otherwise an error will be reported.

?Win10 trick: let the file explorer title bar display the process ID

Recommend article

Relate article