DOS/Command Shell Question re: moving files

I have several CDs worth of data that is structured in the following (annoying) manner:

DIRECTORY
–SUBDIRECTORY
----SUBSUBDIRECTORY
------SUBSUBSUBDIRECTORY
--------FOLDER 1(each folder contains 2 files, one .WAV and one .RTF)
--------FOLDER 2 (ditto above)
--------FOLDER 3 (ditto)
--------AND SO FORTH

What I need to do is move the .RFT files all into one place. Unfortunately, each .RFT file has its own folder. Without individually navigating into every single folder and manually copying the file to where I need it, what can I do?

Do you have to do this with DOS? I’d think the easiest way would be something along the following lines: (in windows XP, mostly for the sake of example)

  • right click on the root directory and select ‘search…’

  • In the search box, either pick type of file: rich text format (under ‘more advanced options’) or just type rtf into the filename box.

once the search ends, select all the files that have been found and use cut-paste or drag and drop to get them where you want. If the files are still on CD-R’s, you may need to copy instead of moving.
Does this help at all??

Windows XP has a FOR command in the command prompt. Reading “HELP FOR” it looks like you can do the following:

FOR /R %i IN (*.rtf) DO move %i C:\NewLocation

However, definitely test it first like this:

FOR /R %file IN (*.rtf) DO @echo move %file C:\NewLocation

Which will basically print the commands it will execute.

This can probably be achieved programatically through some fancy means, but a simple way to do it is to use pkzip or rar to add all of the subfolders and their contents to an archive, while omitting the option that preserves the directory structure. Then, unzip the archive to dump everything in one place. Actually, the option to preserve directory structure might be on the unzip command, I don’t remember.

The same operation is probably also possible through the WinZip UI.

Oops, that second command should be %i instead of %file (variables need to be one letter apparently).

Also, you’d run this from the toplevel directory.

dangit, I’ll preview next time, I promise

I agree that plain old Windows search is the easy way to go. Under the advanced options, you can choose a folder to search and just specify the extension. Once it finds everything, just copy the file where you want. Use control click and shift click to pick individual files in the list or whole ranges.

:smack:

I swear, I love making things more complicated than they need be.