I have a main directory with hundreds of subdirectories, each containing one or more .cue
files.
Main Directory
|
+---Subdirectory1
| .cue1
| .cue2
|
+---Subdirectory2
| .cue1
|
+---etc.
I need a batch file which I can run in Main Directory
, and will create a .m3u
file in each subdirectory. The .m3u
file should be named matching its parent directory name, with content listing each .cue
file it shares that parent with, but as a relative path.
I found this script online:
rem Execute it in the directory which includes music files
rem It requires one argument which will become created m3u playlist file's name
for %%i in (*.mp3,*.mp4,*.m4a,*.wma,*.wav) do echo %cd%\%%i >> %1.m3u
I know enough to modify (*.mp3,*.mp4,*.m4a,*.wma,*.wav)
to (*.cue)
and it works if I put it into a subdirectory, but the .m3u
it produces is nameless, and the paths inside it are absolute. (I can actually work with the absolute paths to the .cue files if making them relative is impossible, but it would take a long time to run this in every directory and rename the m3us as I went.)
Any help would be appreciated.