Use Windows PowerShell to Rename Files

Learn how to rename many files with one command in Windows PowerShell.

John Savill

September 11, 2013

1 Min Read
Use Windows PowerShell to Rename Files

Q: How can I rename a large number of files by using Windows PowerShell?
A: I recently wanted to rename a portion of a large number of files. The best way I found to accomplish this was by using PowerShell, which made it very easy to rename only a specific part of the file name. The command I used is shown below:
 

get-childitem *.wmv | foreach {Rename-Item $_ $_.Name.Replace("oldstring","newstring")}

 

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like