Finally found PowerShell relative to the location of the utility of CMD.
The thing is this, I downloaded some American drama (sorry, read will delete), usually the file name is longer, contains a lot of information I do not need, such as:
Copy Code code as follows:
Don't lie to me. Lie.to.me.s02e11.chi_eng.hdtvrip.720x396-yyets Everyone film and television v2.rmvb
Don't lie to me. Lie.to.me.s02e12.chi_eng.hdtvrip.720x396-yyets everyone film and television. rmvb
Don't lie to me. Lie.to.me.s02e13.chi_eng.hdtvrip.720x396-yyets Everyone film and television v2.rmvb
Don't lie to me. Lie.to.me.s02e14.chi_eng.hdtvrip.720x396-yyets everyone film and television. rmvb
All I want is to:
Copy Code code as follows:
Lie.To.Me.S02E11.rmvb
Lie.To.Me.S02E12.rmvb
Lie.To.Me.S02E13.rmvb
Lie.To.Me.S02E14.rmvb
Since I needed the filename to be a fixed part of the original filename, I thought of PowerShell and tested it first:
Copy Code code as follows:
foreach ($i in (dir *)) {write-host $i. name.substring (6, 17);}
Since there are no other "no" files in this folder, I can use (dir *) to list all the files I need to rename. Then for each 6th to 23rd character that takes its filename: $i. name.substring (6, 17)
The display is like this:
Copy Code code as follows:
Lie.To.Me.S02E11.
Lie.To.Me.S02E12.
Lie.To.Me.S02E13.
Lie.To.Me.S02E14.
Then add the last extension rmvb, and the final command is this:
Copy Code code as follows:
foreach ($i in (dir *)) {$i. MoveTo ($i. name.substring (6) + "RMVB");}
Tip: The current path of the PowerShell does not follow the CD instruction change, and you need to adjust the current path with [environment]::currentdirectory = $pwd before using MoveTo.