Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Windows XP: how do I add 00 in front of every file via command prompt?

I tried REN * 00*.gif but it doesn't work.

share|improve this question
1  
I know this isn't exactly what you've asked for but there is a program called Bulk Rename Utility that does this and a lot more. I see someone has already answered how to do this via command prompt so you should be set that way :) –  victoroux Nov 21 '11 at 19:21

1 Answer 1

up vote 6 down vote accepted

If you really want to rename everything:

for %a in (*.*) do ren %a 00%a

If you only want to rename .gif files:

for %a in (*.gif) do ren %a 00%a

If you need to add the prefix to file names with spaces in them put quotes around the %a and 00%a at the end of the line, i.e.

for %a in (*.*) do ren "%a" "00%a"
share|improve this answer
    
great! it works! –  reyes Nov 21 '11 at 19:30
2  
For future reference: this works properly on Windows XP but not on Windows 7; one of the files will be double-renamed (so x.gif would become 0000x.gif in this case). The easiest workaround is to create a new directory and use move instead of rename: move %a x\00%a –  Harry Johnston Nov 21 '11 at 20:37
1  
I'm not seeing the double rename problem on Windows 8, maybe they fixed it –  PsychoDad Nov 13 '12 at 15:42

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.