Computing.Net > Forums > Disk Operating System > Rename multiple file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Rename multiple file

Reply to Message Icon

Name: regall2008
Date: August 12, 2008 at 22:12:21 Pacific
OS: winxp
CPU/Ram: amd/1Gb
Comment:

i'm newbie of dos mode.
i want this result
235-abcd.mp3 -> abcd.mp3
059-wxyz.mp3 -> wxyz.mp3

[3 digit][-][name].mp3 -> [name].mp3

i have a lot of files like this...
How i do???

thank a lot



Sponsored Link
Ads by Google

Response Number 1
Name: DosX
Date: August 13, 2008 at 07:17:18 Pacific
Reply:

I don't know how to do it with dos command prompt..it would be difficult if not impossible. For DOS it would be better to use some kind of real programming language. But since you are using Windows XP and CMD.exe (which is verry much different than real DOS) it might be doable in batch. But you would need to ask that on a Windows XP part of the forum. Or perhaps at Programming part.


0

Response Number 2
Name: DAVEINCAPS
Date: August 13, 2008 at 20:21:33 Pacific
Reply:

Unless you absolutely have to do it in dos or command prompt, you can try one of these:

http://www.webattack.com/freeware/s...


0

Response Number 3
Name: Mechanix2Go
Date: August 13, 2008 at 23:30:12 Pacific
Reply:

Like DosX indicates, could be an uphill battle in DOS.

You need to state the EXACT version. And, are they all strictly the same naming convention?


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 4
Name: Valerie (by Garibaldi)
Date: August 19, 2008 at 16:47:05 Pacific
Reply:

Win XP Home - Command Prompt.

I think the code below should do it. To rename files remove echo from the ren line when you have ensured that your outcome will be good. You will have to amend the in_file variable to the path of your files. Code has not been tested where there are space(s) in the path\filename.

Good luck.

:: Code start...............
@echo off
setlocal

set in_file=d:\temp\
for /f "tokens=*" %%a in ('dir /b %in_file%*.mp3') do call :rename %%a
goto :EOF

:rename
set oldname=%1
set newname=%oldname:~4%
echo ren %in_file%%oldname% %newname%

echo Old file name = %oldname%
echo New file name = %newname%
:: Code finish................


0

Response Number 5
Name: TommyCee
Date: August 30, 2008 at 19:00:42 Pacific
Reply:

You simply want to crop the 1st 4 chars of the existing filenames; try this:

@echo off
for %%i in (*.mp3) do (set fName=%%i) & call :rename
goto :eof
:rename
:: Crops the 1st 4 characters of fName):
ren %fName% %fName:~4%
goto :eof

Tommy


0

Related Posts

See More



Response Number 6
Name: Mechanix2Go
Date: August 30, 2008 at 22:56:39 Pacific
Reply:

You can't call a subroutine in DOS.

Anyway, The OP seems to have lost interest.

12 AUG LOL


=====================================
If at first you don't succeed, you're about average.

M2


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Rename multiple file

Rename multiple Files www.computing.net/answers/dos/rename-multiple-files/14239.html

Renaming Multiple Files www.computing.net/answers/dos/renaming-multiple-files/13297.html

Renaming multiple files www.computing.net/answers/dos/renaming-multiple-files/15167.html