Batch renaming multiple files

August 9, 2011 at 04:35:01
Specs: Windows XP
Hi,

I need to add a .bat file to my context menu that will rename all selected files with prefix.

old files:
article.txt
pic.jpg
video.avi

new files:
used_article.txt
used_pic.jpg
used_video.avi

eventually I will bind this bat file to autohotkey so with a shortkey (win+F5 or whatever) i can do this repetitive task. And I will need to setup multiple conditions into separate bat files later (prefix - "used_", suffix - "_date", etc). Thank you very much for any help. Sorry for my incompetance


See More: Batch renaming multiple files

Report •

#1
August 11, 2011 at 06:00:07
Untested:
:Loop
IF "%~1"=="" GOTO :EOF
REN %1 "used_%~nx1"
SHIFT
GOTO Loop

How To Ask Questions The Smart Way


Report •

#2
August 17, 2011 at 06:56:07
Thank a Lot. It's working perfectly.

I can not believe there is absolutely no application that does just this.


Report •
Related Solutions


Ask Question