1
0 Comments

I possess numerous folders that contain the names of various musicians, and these folders may include one or more subfolders with the names of albums. For instance, as an illustration:

Michael Jackson\Invincible (Album)
Michael Jackson\Thriller (Album)
Luciano Pavarotti\'O sole mio (Single)
Queen\Bohemian Rhapsody (Single)

My intention is to modify the names of all folders that include the phrase ” (Album)” and retain only the name of the album itself. To use the previous illustration as an example:

Michael Jackson\Invincible
Michael Jackson\Thriller
Luciano Pavarotti\'O sole mio (Single)
Queen\Bohemian Rhapsody (Single)

I possess this code, but I am unsure about how to locate folders that have the term ” (Album)” in their names and remove it.

@echo off
setlocal disableDelayedExpansion

for /d %%A in (*) do (
    set "folder=%%A"
    setlocal enableDelayedExpansion

    REM rename folder

    endlocal
)

To be honest, I have never attempted anything of such intricacy before. If someone could assist me with this, I would be extremely grateful.

Askify Moderator Edited question April 25, 2023