In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to use PowerShell to replace file names in batch in Win10? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
The specific methods are as follows:
As shown in figure 1, the show I downloaded before is named "Lang Medical Gold 01, Langyi Gold 02, Langyi Gold 03." Named in this order, now replace the words "wave doctor money" in all documents with "romantic doctor master Kim". Obviously, if one by one change is quite troublesome, the efficiency is not high, so batch processing method should be adopted.
▲ figure 1
Open notepad to write content as shown in figure 2, in which the path is saved to the variable $Path (my habit is that every time a new episode is downloaded, it is saved to this directory, so that this variable does not have to be changed later), $Filter saves the filter conditions for the variable (such as * .mkv, that is, all mkv video files written here), $oldtext is the original file name keyword (Lang Medical money), and $newtext represents the keyword to be replaced (romantic doctor Master Jin).
▲ figure 2
The following sentence is roughly translated: ls means to get a directory, followed by $Path to get the directory within this variable (what is this variable? As mentioned above, the directory where the file is saved), the parameter-Include means to include, followed by the variable $Filter (yes, the condition we want to filter is saved in the $Filter variable, that is, * .mkv), and then processed through the pipeline "|", ForEach-Object means personalized processing, the content in curly braces is: {rename $_. Full name $_. full name。 Replace ('$oldtext','$newtext')} ($_ represents the current data, that is, all the mkv files in the directory you just obtained)-- finally execute the script and name it instantly (figure 3).
▲ figure 3
Isn't it very simple? You can save this script for later use, just modify the variables $oldtext and $newtext later.
This is the answer to the question about how to use PowerShell to replace file names in batch in Win10. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.