Welcome to the SO platform
Supposing that the string in the names (ABC,CBA,BAC,BCA) sane:
- Exactly those and only those in this sequence
1) Implement a counter
2) list the mp3 files filters in the loop strings in desired sequence: ABC,CBA,BAC,BCA
3) remove the first 2 characters
4) seven the desired sequence
5) renaming
Obs.: Edit the command: Set "_path_mp3=."
Substituting the value: "=."
for "=drive:\pasta\onde\tem\os\mp3s"
So that it stays: set "_path_mp3=drive:\pasta\onde\tem\os\mp3s"
| Reordenar.cmd: |
@echo off && setlocal enabledelayedexpansion
cd /d "%~dp0" & set "_path_mp3=." & cd /d "!_path_mp3!" & set /a "_cnt=0"
for %%F in (ABC,CBA,BAC,BCA)do for /f "tokens=*delims= " %%i in ('where .:"*.mp3" ^| find /i "%%F"')do (
set /a "_cnt+=1" && set "_arq_=%%~ni"
set "_cmd_ren_[!_cnt!]=rename "%%~fi""
set "_arq_[!_cnt!]=!_arq_:~2,-3!%%F.mp3")
for /l %%L in (1 1 !_cnt!)do !_cmd_ren_[%%L]! "%%L !_arq_[%%L]!" & where .:"%%L !_arq_[%%L]!" /t
| Resulta: |
What would be the ordering rule you want to use?
– RXSD