views:

300

answers:

7

I have a bunch of MP3 files split up into artist\album, and I want to move these all into a single directory, and get rid of the directory itself, using a windows batch file (hence the tags)

+4  A: 

Use the Windows search function to search for *.MP3, wait for it to finish. Select all results and use cut. Paste into the target directory.

Then the subdirectories should be empty. You can select them all at once and delete them.

Thorarin
Gordian knot, meet sword :)/ +1
DVK
I want to be able to do this in a batch file as part of a multi-step process or renaming and using a command line tagging program, and I am missing this step right now.
esac
A: 

fs-dependent, filenumberlimit experimental result was you can have thousands of files same level here, didn't try > 10000, > 1000 ok

LarsOn
A: 

This should be moved to superuser, first off. Second, I use MusicBrainz for my mp3 library.

Since the question has gotten more complex, let me elaborate on MusicBrainz.

You point it at a music folder, deep as you want, and it grabs all songs found in that directory. It then offers to retag them based on it's user-generated DB. It uses some crazy method of audio finger printing to guess any songs that either lack meta-data or need the right meta-data (say goodbye to Aretha Franklin doing "Son of Preacher Man" and the famous Rolling Stones cover of "Brown Eyed Girl").

After finishing up with any meta data correction, you hit save, and it will:

a) replace/add the meta data tags

b) move your mp3 files into directories based on any pattern you specify

c) if you set this, it will delete any folders that it leaves empty upon file relocation

So, you could simply tell it NOT to retag and NOT to use any meta data for folder destination, and it will all that you want (and more if you want it to).

I have mine set to grab stuff from my "Giant Music Mess" folder and then put them into folders based on artist, album, disc, and finally give the mp3 file a "track# - title" rename. Something like Music Library/%Artist%/%Album%/%Vol%/%#% - %title

Anthony
he does ask for a batch solution, that is coding (somewhat).
lexu
Agreed, but I have a suspicion that his intention is to do this only for himself (meaning not distributed or part of a larger project) and probably only once or twice. Thorain's perfect answer reflects this, me thinks.
Anthony
+2  A: 

For a bit of an overkill of an effort, install any Unix utilities (e.g. CYGWIN, many oithers) and do "mv //* final_dir" :)

Of course, you will be left with a highly useful and uber cool set of unix utilities for Windows.

Another overkill is t install ActivePErl and do it in Perl:

map { move($_, $final_dir) || die "Can not move $_: $!" } glob("basedir/*/*/*");
DVK
Yeah, I know you said batch files. But having programmed in batch years ago, before the ice age, my best advice regarding batch file programming is: DO NOT! Use Poershell, or Perl on Windows. You will make your life MUCH easier.
DVK
A: 

EDIT I see you want to do wit with "win batch" (in one of your comments added later)... I leave my answer up as an alternative...

I've used JP soft's 4NT (a command.com replacement) to do this.

cd <root of mp3 tree>
global /i move *.mpr \newdir

just beware that newdir aboslutely must not be a child of <root of mp3 tree>

global executes a command (the move command) in every subdirecotry of the starting directory. /i tells it to ignore returncodes (a directory might contain zero mp3 files).

4NT is nolonger sold but "Take Command" should work also.

lexu
WinBatch is an entirely different thing than Windows Batch files. Careful.
Joey
A: 

artist>move *.mp3 destinationDirectory will work I believe.

RN
+5  A: 

You can start from:

for /R %%x in (*.mp3) do move "%%x" "c:\dir"
Sergius
Thanks, that did it.
esac