Hey BC_Programmer,
I added the below code to a .BAT file but it didn't work.
SETLOCAL ENABLEDELAYEDEXPANSION
for /f "usebackq delims=" %%P in (`dir /b /ad`) do (
pushd %%P
for /f "usebackq delims=" %%I in (`dir /b /ad`) do (
copy "%%I\*.*" .\
REM rd /s /q "%%I"
)
popd
)
When I added the code as is, it didn't move any files or delete anything. When I removed the REM it just deleted everything except the parent directories.
Am I doing something wrong? I ran the .BAT file from "S:\MUSIC\test.bat" and these are the exact files I had in the directory:
S:\MUSIC\dalek vs faust\2004 - derbe respect, alder\dalek vs faust v0\01 jhevevevj.mp3
S:\MUSIC\dalek vs faust\2004 - derbe respect, alder\dalek vs faust v0\02 83fjh3v3v.mp3
S:\MUSIC\dalek vs faust\2004 - derbe respect, alder\dalek vs faust v0\03 jeje vv urvfrv.mp3
S:\MUSIC\dalek vs faust\2004 - derbe respect, alder\dalek vs faust v0\folder.jpg
S:\MUSIC\mazzy star\1991 - she hangs brightly\she hangs brightly\01 whh whh whaaamp3
S:\MUSIC\mazzy star\1991 - she hangs brightly\she hangs brightly\02 bleeef dikee aa.mp3
S:\MUSIC\mazzy star\1991 - she hangs brightly\she hangs brightly\03 !.mp3
S:\MUSIC\mazzy star\1991 - she hangs brightly\she hangs brightly\playlist.m3u
I had hoped that it would produce the following:
S:\MUSIC\dalek vs faust\2004 - derbe respect, alder\01 jhevevevj.mp3
S:\MUSIC\dalek vs faust\2004 - derbe respect, alder\02 83fjh3v3v.mp3
S:\MUSIC\dalek vs faust\2004 - derbe respect, alder\03 jeje vv urvfrv.mp3
S:\MUSIC\mazzy star\1991 - she hangs brightly\01 whh whh whaaamp3
S:\MUSIC\mazzy star\1991 - she hangs brightly\02 bleeef dikee aa.mp3
S:\MUSIC\mazzy star\1991 - she hangs brightly\03 !.mp3
Ideally I would have liked it to move only the .MP3 files and then for it to remove the directories the MP3s were moved from and any non-MP3 files they contain.
It needs to be something generic though, as there are about 2000 more "dalek vs faust" and "mazzy star" level directories with the exact same structure.
Please let me know if this isn't clear. Thank you.