How to replace batch file name strings using Windows PowerShell
?
Ex: Replace the "" character with "_" of all files in a folder.
How to replace batch file name strings using Windows PowerShell
?
Ex: Replace the "" character with "_" of all files in a folder.
To do this you can use the following command:
Dir -R | Rename-Item -NewName { $_.name -replace " ","_" }
In this case you will recursively search for and rename files (thanks to -R ).
You can also filter files that will be renamed by extension using a *.cpp
Dir -R *.cpp| Rename-Item -NewName { $_.name -replace " ","_" }