I need to rename over 100 folders.

Currently the folder names include a comma. for example:

Week1, Monday

I need to rename this to:

Week1 Monday

I just simply need to remove the comma.

I’d like to be able to do this in Powershell if possible, but any way will be great.

I’ve tried a few things, but I’m not getting anywhere.

Thanks for any help.

9 Spice ups

This should help:

Remove commas from folder names - PowerShell - Spiceworks

Remove-commas-from-folder-names

Have what you tried where are you stuck?

Have you looked at the PowerRename feature of Microsoft PowerToys?

It maybe able to do what you are looking to do.

I use this quite a lot. I use it on files but it says it will do folders as well.

2 Spice ups

I agree, PowerShell all the way…

https://ss64.com/ps/replace.html

#Get all the sub directories of the main
Get-ChildItem -Path C:\Temp -Directory | ForEach-Object {
   #do something with each directory.
   Rename-Item $_.FullName -NewName $_.FullName.Replace(",","")
}

From there you can use any variation of string manipulation to get the desired output, in this example I just removed the “,”, but you could add formatted dates, make decisions based on directory name, etc…

1 Spice up

up for bulk rename too…

just untick “files” and it work for folders

Thanks everyone, I appreciate the help, I’ll check all the suggestions out, much appreciated.