Batch Renaming of Files using PowerShell

Windows PowerShell is a very powerful tool for many tasks. The following are two examples using it for batch renaming of files in a folder.

1) Removing the first character from the existing filename, and

2) Replacing a special character with another character in the filename. Adjust the parameter value for your specific requirements.

get-childitem *.txt | rename-item -newname { string.substring(1) }

Dir | Rename-Item –NewName { $_.name –replace “+”,” ” }

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.