Batch REN command
Posted on 2004-09-14
I have a bunch of files in a folder that need to all be renamed to include "1_" in front of them.
I need to run a RENAME command that will take each filename in a folder and rename it to the same name it currently is and place a number with an underscore in front of it. like so:
Old File Name: myfile.txt
New File Name: 1_myfile.txt
It should do this for every file in the folder.
I have already tried
REN C:\TEST\* 1_*
But that seems to take the first two characters of the filename and replace them with "1_". So the file ends up looking like this "1_file.txt", notice the "my" has been replaced with "1_". I need to keep the existing name after placeing the "1_" in front of it.
Any help is greatly appriciated.