Finally, I found that PowerShell is practical compared to CMD.
This is the thing. I downloaded some American TV series (sorry, I will delete it after watching it). Usually the file names are relatively long and contain a lot of information that I don't need, such as:
Copy the codeThe code is as follows:
Don't lie to me...S02E11.Chi_Eng.HDTVrip.720×396-YYeTs Renren Film and Television
Don't lie to me...S02E12.Chi_Eng.HDTVrip.720×396-YYeTs Renren Film and Television.rmvb
Don't lie to me...S02E13.Chi_Eng.HDTVrip.720×396-YYeTs Renren Film and Television
Don't lie to me...S02E14.Chi_Eng.HDTVrip.720×396-YYeTs Renren Film and Television.rmvb
All I want is:
Copy the codeThe code is as follows:
.
.
.
.
Since the file name I need is a fixed part of the original file name, I thought of PowerShell and test it first:
Copy the codeThe code is as follows:
foreach ($i in (dir not *)){ Write-Host $(6, 17); }
Since there are no other files starting with "not" in this folder, I can use (dir *) to list all the files I need to rename. Then take the 6th to 23rd character of its file name for each: $(6, 17)
It shows like this:
Copy the codeThe code is as follows:
.S02E11.
.S02E12.
.S02E13.
.S02E14.
Then add the last extension rmvb, the final command is as follows:
Copy the codeThe code is as follows:
foreach ($i in (dir not *)){ $($(6, 17) + "rmvb"); }
Tip: The current path of PowerShell does not change with the CD instruction. Before using MoveTo, you need to use [Environment]::CurrentDirectory = $pwd to adjust the current path.