Rename/Append Batch Command in DOS

  beastieboy 18:47 05 Jul 2003
Locked

Hi, I have got the below code to rename several MP3 files from 01.mp3 to "Glastonbury 2003 CD 1 - - 01.mp3" and son on:

@echo off
cls

set StartText="Glastonbury 2003 CD 1 - "

echo.
echo This script will append the string: %StartText% to
echo each target file
pause
set myName="%StartText%01.mp3"
ren e:\Mirc\Glasto~1\CD1\01.mp3 %myName%
set myName="%StartText%02.mp3"
ren e:\Mirc\Glasto~1\CD1\02.mp3 %myName%
set myName="%StartText%03.mp3"
ren e:\Mirc\Glasto~1\CD1\03.mp3 %myName%
set myName="%StartText%04.mp3"
ren e:\Mirc\Glasto~1\CD1\04.mp3 %myName%
set myName="%StartText%05.mp3"
ren e:\Mirc\Glasto~1\CD1\05.mp3 %myName%
set myName="%StartText%06.mp3"
ren e:\Mirc\Glasto~1\CD1\06.mp3 %myName%
set myName="%StartText%07.mp3"
ren e:\Mirc\Glasto~1\CD1\07.mp3 %myName%
set myName="%StartText%08.mp3"
ren e:\Mirc\Glasto~1\CD1\08.mp3 %myName%
set myName="%StartText%09.mp3"
ren e:\Mirc\Glasto~1\CD1\09.mp3 %myName%
set myName="%StartText%10.mp3"
echo.
echo Process Complete
echo Press Any Key To Exit
pause>nul
cls
exit

However it does not work, I am running XP Pro, not sure if this makes difference, but please someone help.

Many thanks,

Janusz

P.S. The CD is brought by myself and in my room. I am making backups and was testing with batch renaming.

  jazzypop 18:55 05 Jul 2003

As you have just found out, to start a new line in this Forum, you have to press Enter twice, not once.

Can I suggest you repost, so that we can see where each line starts and ends?

BTW, with XP, you do not have to use DOS to rename multiple files - see click here

  beastieboy 19:04 05 Jul 2003

Here it is:

@echo off

cls

set StartText="Glastonbury 2003 CD 1 - "

echo.

echo This script will append the string: %StartText% to

echo each target file

pause

set myName="01.mp3"

ren e:\Mirc\Glastobury2003\CD1\01.mp3 %myName%

set myName="%StartText%02.mp3"

ren e:\Mirc\Glastobury2003\CD1\02.mp3 %myName%

set myName="%StartText%03.mp3"

ren e:\Mirc\Glastobury2003\CD1\03.mp3 %myName%

set myName="%StartText%04.mp3"

ren e:\Mirc\Glastobury2003\CD1\04.mp3 %myName%

set myName="%StartText%05.mp3"

ren e:\Mirc\Glastobury2003\CD1\05.mp3 %myName%

echo.

echo Process Complete

echo Press Any Key To Exit

pause>nul

cls

exit

  beastieboy 19:27 05 Jul 2003

Got a program called filemonkey which can do the renaming, I'm alright with clean renaming of Files, but I have quite a lot in this format:

01.mp3, 02.mp3,..., 20.mp3

I want to add text to make them read something like:

Glastonbury CD 1 - 01.mp3, Glastonbury CD 1 - 02.mp3,..., Glastonbury CD 1 - 20.mp3

I want to keep the original file name, but want to append a certain string to the front of it

Janusz

  jazzypop 23:42 05 Jul 2003

That's exactly what XP's built-in facility does - check out the link I gave above (and the links within that article) - try it :)

  beastieboy 14:30 06 Jul 2003

Tried it, but it names it all the same and then it just adds (1), (2) to the end which means I have to go to each one anyway and change it

Janusz

  Pesala 16:51 06 Jul 2003

File Menu, Batch Conversion/Rename, select the file names (any files can be renamed not just graphic files).

$ = old file name

# = one digit

  beastieboy 16:53 06 Jul 2003

Got software similar to what U said - it's called batch rename .exe

Cheers though

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5 review

See the work of famous artists playing with toys

iPad Pro 10.5in (2017) review

Comment faire une capture d’écran sur un Mac ?