Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use PowerShell to create new folders in batch

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to use PowerShell to create a new folder in batch". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

It has been introduced before to create files and folders in batches with the aid of Excel, but this time we introduce a method of batch creation of files and folders with PowerShell, which is easier than the previous method and can be done with one command.

The specific methods are as follows:

1. Open PowerShell (no administrator permission is required)

2. Switch to the desired folder in the same way as the command prompt

PS: if you are not familiar with the command, you can not switch it. After you finish building it, you can directly move it to the target location.

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, indicating that the integer 1-10 is used when naming, these numbers can be customized; the content in the braces {} is the text before the sequence number, which shows "IThome", and these words can also be customized, and the "$_" after the character refers to the previous number. As can be seen from the picture above, it doesn't hurt to change the number to "11. 20".

When copying and pasting the above command, some versions of PowerShell may have display problems. Make sure that there is no problem with the displayed text before executing the command (moving the cursor over the wrong character may correct it), otherwise an error will be reported.

This is the end of the content of "how to use PowerShell to create a new folder in batch". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report