Moving files with original structure?

Permabanned
Joined
27 Jan 2006
Posts
7,288
What command in DOS would I need to type to move certain files from one directory to another, keeping original file structure intact?

Main directory
\Music\Artist\Album

Move all .flac files to \Music\flac\Artist\Album
Move all .mp3/other lossy files \Music\flac\Artist\Album

There are also .jpg/.png files in each directory for album art, so want to keep them together with respective albums too.
 
Erm, forgive me for sounding silly here, but why would you want to split up files based purely on their file type, when you already seem to have a very good folder structure already?

(I've been fighting this arguement since I started at my current job, where everyone used to sort their files by Word/Excel/Powerpoint, rather than by what they're about!)

Secondly, you've listed you want .flac files and .mp3 etc all to go to a Music\flac\ album...
 
you've listed you want .flac files and .mp3 etc all to go to a Music\flac\ album.

oops yeah I mean flac in \flac, mp3 in \mp3 dir

Stucture is useful for having two directories, with lossy and lossless in seperate main structures. Structure system doesn't matter to winamp/slimserver it's just so that I can quickly select the lossless directory and convert those to mp3, leaving the mp3 directory alone.

Something like

cd\music
c:\music: Xcopy *.flac c:\music\flac /s

But move version of xcopy

Why in DOS?

More powerful copy/move feature.
 
I'm not aware of an xcopy 'move' type operation unfortunately, if anyone is aware it would be very handy for me, as I often have to do the same thing but with tifs/jpgs and tifs/pdfs.

Personally I would write a small batch script to do the dirty work.

Perhaps you could do something along the lines of:


cd /D 'main directory'
dir *.flac /B /S > c:\list.txt
xcopy the directory structure somewhere else
cd new location
dir /B /S > c:\list2.txt


Open file in excel, add in another couple of columns, and have
Code:
     A             B                    C                     D                  E                              F 
MOVE        " "(space)    first line of c:\list.txt   " "(space)      first line of c:\list2.txt    A1&B1&C1&D1&E1

Copy column F to a tmp.bat file and run it

Then cd new location

search and replace mp3 with flac in list2.txt and save as list3.txt

Pastes again in excel and end up with

Code:
     A             B                    C                     D                  E                              F 
REN        " "(space)    first line of c:\list2.txt   " "(space)      first line of c:\list3.txt    A1&B1&C1&D1&E1



then save again as tmp1.bat and run it should change the folder names.



Test all this on a sample first. Really hacky but would work for a one off.



<edit> > or if you have enought disk space/time just copy it all, and then F3 in explorer, search for *.mp3 in the flac and CTRL+A, DEL, and vice versa for the *.flac in the MP3. --- Misread above post, you don't have mp3 already there(in the path). So that's it really, job done, just add MP3 and FLAC root folders at the top of the tree. This keeps other files as well.
 
Last edited:
More powerful copy/move feature.

So opening up two Windows Explorers and dragging & dropping your files into their respective directories is less powerful than DOS?
Don't get me wrong, I love DOS and use it to impress people when they're standing over me but in your case open up two Explorers, it'll be a lot easier.
 
So opening up two Windows Explorers and dragging & dropping your files into their respective directories is less powerful than DOS?
Don't get me wrong, I love DOS and use it to impress people when they're standing over me but in your case open up two Explorers, it'll be a lot easier.

He might have 2000+ directories, that could take a while
 
or if you have enought disk space/time just copy it all, and then F3 in explorer, search for *.mp3 in the flac and CTRL+A, DEL, and vice versa for the *.flac in the MP3.

Yeah I've that in the past, when I had enough space on another hard drive. But at 100GB + and one thousand directories.
 
He might have 2000+ directories, that could take a while

It'll take a lot less time than typing out DOS commands.
Drag & Drop with the right mouse button and choose MOVE.
If he needs to search 2000 directories for FLAC files and MOVE them into one directory then its easily done in Explorer.

What command in DOS would I need to type to move certain files from one directory to another, keeping original file structure intact?

Main directory
\Music\Artist\Album

Move all .flac files to \Music\flac\Artist\Album
Move all .mp3/other lossy files \Music\mp3\Artist\Album

There are also .jpg/.png files in each directory for album art, so want to keep them together with respective albums too.

All he does is create a directory called \Music\flac\Artist\Album and then using Explorer he moves them into the new directory.

I can't see why people are using a bulldozer to make a tiny sandcastle.
 
It's impossible to do what the OP wants using just Explorer. It would be doable if he wanted every FLAC file inside the \Music\flac\ folder, but you can't keep the Artist\Album directory structure that way.

OP: Have a look at Robocopy, especially the /XF switches and /L to test without moving anything.
 
Last edited:
Okay, I must be missing something here.

He has a directory called Music
In that directory he has eg : ACDC
in the ACDC directory he has 2 directories called Highway To Hell and Powerage

Of course he also has a directory called eg: Black Sabbath and thats full of different album directories.

And this goes on for another 1000 or so albums.

He wants to put the FLAC files in a new directory inside the MUSIC directory called FLAC.

All he has to do is grab all the Artist directories and drop them into the FLAC directory.

And then do the same with the MP3's.

Have I missed something?
 
Because each artist has flac and mp3 albums, with hundreds of albums it'll take ages to do that. You can't just search .flac files as that won't keep original directory structure.

I believe there used to be a Xmove .exe, not included with MS-DOS but written by a third party that could do what I'm asking.
 
Because each artist has flac and mp3 albums, with hundreds of albums it'll take ages to do that. You can't just search .flac files as that won't keep original directory structure.

I believe there used to be a Xmove .exe, not included with MS-DOS but written by a third party that could do what I'm asking.

I now see where you're coming from.

X-Move - http://www.google.co.uk/search?hl=en&q=xmove.exe&btnG=Google+Search

I also use a File Manager called Directory Opus which could do it.
 
Just a minor point, it's not DOS, it's the command prompt. I wouldn't trust a 16-bit DOS app with moving my music collection around :)
 
Back
Top Bottom