Monday, 4 April 2016

Batch file rename using Powershell

The following command lists the files in the current directory and pipes the list to Rename-Item. Rename-Item replaces each space character with an underscore.
Dir | Rename-Item –NewName { $_.name –replace “ “,”_” }

No comments:

Post a Comment

Note: only a member of this blog may post a comment.