I'm trying to move files to folders based on artist and album names but the new filename is always relative to the current file location and not a fully qualified path from the root of the drive. Assuming that files will be moved from and to the same drive is acceptable. My file structure is:
\
.....My Music\
..........Album Artist 1\
...............(Year) Album A\
....................Track - Title.mp3
..........John E. Guitarplayer\
...............(2023) Hit Songs\
....................001 - Happy Song.mp3
..........Album Artist 3\
...............(Year) Album C\
....................Track - Title.mp3
..........Unsorted Tracks\
...............Title.mp3
..........Other files\
...............New Music Files\
....................Target File.mp3
I use mp3tag to load correct tag information then use a format string to rename and move the files to appropriate folders:
Current Directory: G:\My Music\Other Files\New Music Files
File: Target File.mp3
AlbumArtist: John E. Guitarplayer
Year: 2023
Album: Hit Songs
Track: 002
Title: Sad Song
\My Music%albumartist%(%year%) %album%$num(%track%,3) - %title%
I'm expecting to get:
\
.....My Music\
..........John E. Guitarplayer\
...............(2023) Hit Songs\
....................001 - Happy Song.mp3
....................002 - Sad Song.mp3
..........Other files\
...............New Music Files\
Instead, I get:
\
.....My Music\
..........John E. Guitarplayer\
...............(2023) Hit Songs\
....................001 - Happy Song.mp3
..........Other files\
...............New Music Files\
....................My Music\
.........................John E. Guitarplayer\
..............................(2023) Hit Songs\
...................................002 - Sad Song.mp3
A new path is created in the original folder even though my format string begins with a backslash. It works the same with or without the leading backslash.
This works fine if I specify the drive letter:
G:\My Music%albumartist%(%year%) %album%$num(%track%,3) - %title%
But I can't be sure what letter Windows might assign each time I mount a removeable drive. Is there a way to reference the "current drive" in a format string?
This also works but I'd have to assume I'd never be more than 10 levels deep in the file structure:
....................\My Music%albumartist%(%year%) %album%$num(%track%,3) - %title%
It's not very elegant but gets the job done until I find myself 11 or more levels deep. Then, God knows where the file may be relocated to. Is there a better way to handle this?