Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a lot of files that I need to change part of their file name and figure it will be easiest to do in DOS. For example, I want to change the file names:
tro344-07-MySong-MyAlbum.mp3 and
tro344-08-YourSong-YourAlbum.mp3I want to get rid of the tro344-07- and the tro344-08-
so that I am left with:
MySong-MyAlbum.mp3 and
YourSong-YourAlbum.mp3Can you tell me what DOS command I would need to enter to do this? Thanks for you help!

There is no DOS in vist.
============================
@echo off & setLocal EnableDELAYedExpansionfor /f "tokens=* delims= " %%a in ('dir/b/a-d') do (
for /f "tokens=3-4 delims=-" %%i in ("%%a") do (
echo ren %%a %%i-%%j
)
)
=====================================
Helping others achieve escape felicityM2

Here is another script.
# Script tro.txt cd "/some_directory" var str list, file, newname lf -n "tro*.mp3" > $list while ($list <> "") do lex "1" $list > $file ; stex -p "^-^2[" $file > $newname system rename $file $newname doneSave the script in file C:/Scripts/tro.txt, start biterscripting ( http://www.biterscripting.com ), enter the following command
script tro.txtMake sure you change "/some_directory" to the full path of the directory where files are located, enclosed in double quotes.
Sen

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |