I have a bunch of directories, each one contains exactly 1 file named folder.jpg. What I would like to do is to rename all the files cover.jpg, but when I do search on *.jpg and try to rename, it renames the first file to cover.jpg and every other file becomes cover (1).jpg.
Is there a way I can rename the files without tedious folder-by-folder renaming?
Answer
I would do this with PowerShell:
Get-ChildItem "C:\root\path" -Recurse -Filter "folder.jpg" | % {
Rename-Item $_.FullName "cover.jpg"
}
No comments:
Post a Comment