Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

I would do this with PowerShell:

Get-ChildItem "C:\root\path" -Recurse -Filter "folder.jpg" | % {
  Rename-Item $_.FullName "cover.jpg"
}
share|improve this answer
    
Thank you Sir, that was exactly what I wanted to do. – kyooryu Oct 28 '12 at 12:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.