Recursively add suffix after extension to all files in a directory
Run the below command in PowerShell
Get-ChildItem -File -Recurse | ForEach-Object `
{ Rename-Item $_.FullName $($_.BaseName + ".[xyz@gmail].xyz") -WhatIf }
The -WhatIf
option is to do a dry run. After checking that the new names are correct, just remove -WhatIf
to do the real rename. The equivalent shortened version is
ls -Fi -R | % { ren $_.FullName $($_.BaseName + ".[xyz@gmail].xyz") -wi }