English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

for example i have 10 files, their names go like this:
01 - song1.mp3, 02 - song2.mp3, ... ,10 - song3.mp3

i want to add the name of the singer to these files with one single batch command.so they will be like this:
singer - 01 - song1.mp3, singer - 02 - song2.mp3,...

what dos command should i use in my .bat file?

2006-10-18 06:43:56 · 4 answers · asked by hdd 1 in Computers & Internet Other - Computers

javelinl, tnx for the code i thought it was gonna work but it just didnt rename, is there a little mistake in the "for" command?

2006-10-18 07:10:33 · update #1

it says /f "tokens = * delims=*" was unexpected at this time. then i remove that part and it says %%i was unexpected at this time.

2006-10-18 07:18:37 · update #2

javelinl, its still not working

2006-10-18 10:22:03 · update #3

no wait its working

2006-10-18 10:29:41 · update #4

is there a way to undo this as well? removing something from filenames?

2006-10-18 10:37:01 · update #5

i found that one anyway

2006-10-18 13:07:02 · update #6

4 answers

Edit - Small mistake

Remove the * before ('dir *.* /b')
Code below is correct.

assuming you have all the files in the same folder

SET MYADD=Madonna -
SET MYFOLDER=c:\my songs\madonna

cd "%MYFOLDER%"
for /f "tokens=* delims=*" %%i in ('dir *.* /b') do ren "%%i" "%MYADD%%%i"



This will add Madonna - to all files in c:\my songs\madonna

2006-10-18 06:57:10 · answer #1 · answered by Javelinl 3 · 0 0

If your using only DOS and plan to have a different name for each singer (which I assume is what your doing) you'll have a problem.
If your familiar with basic or have some old dos based dbase software around you can use the rename and/or replace in combination with a few if/when statements. This may be a good time to get your feet wet or wetter doing a little codeing.

2006-10-18 07:00:59 · answer #2 · answered by radar 3 · 0 0

Been a very long time since I tried to do anything in batch, easier in PERL. But if you need to, check out this:

http://www.allenware.com/icsw/icswidx.htm

This should cover everything you need. Sorry I couldn't go into more detail, but at least you have the reference now.

2006-10-18 06:55:14 · answer #3 · answered by jbgot2bfree 3 · 0 0

If I'm not mistaken, I think you use:

rename x.mp3 y.mp3

No comma in the middle

2006-10-18 06:56:58 · answer #4 · answered by gio 2 · 0 0

fedest.com, questions and answers