Why don't you want to keep the directory structure?
If it wasn't for that I would suggest my playlist update program, see link in signature.
I am trying to create a batch file (unless anybody can suggest a better way), that will place all the mp3 files on a usb drive into a directory on my C drive. I will store all the files on the usb drive as /bandName/albumName/songs.mp3, and will want to put them into a directory such as: C:/Music/Albums/
To give you an idea, this is what I have got so far that I have been playing around with:
@echo off
set src=C:\Albums\files
set dst=C:\Albums\files_moved
cls
echo.
echo Processing . . .
for /f "delims=" %%I in ('dir /s /b /a"%src%\*"') do (
copy "%%~I" "%dst%\%%~nxI"
)
echo.
echo The process is complete.
pause >nul
It just copies everything though into the one source folder, and doesn't keep any sort of directory structure. I am thinking it may need some nested for loops to go through the directories, but that is getting beyond my knowledge. Also I am guessing I will be able to just swap the C with the drive name for the USB drive, and if it is connected will always have the same letter and should work?
Any help, suggestions or ideas would be much appreciated.
Why don't you want to keep the directory structure?
If it wasn't for that I would suggest my playlist update program, see link in signature.
Sorry I didn't make that clear. I am wanting to keep the same directory structure, and basically just copy the folders from the usb stick onto the C drive. As far as I can tell I can't do this directly in a batch file, and will need to copy the files individually?
You can using Xcopy instead of copy.
Then have a look at my program.Originally Posted by bnew019
you place one file on the USB, set the source (which will be your USB stick) and destination folder. The program checks every minute (you can change that) to see if the source is available, then it updates the destination from the source.
I am setting up robocopy to sync my files, VERY powerful command line tool. google it.
Jarrod - Holden VX S!
xcopy 'usbdrive letter'\*.* c:\Music\Albums\ /E /Y
that would copy everything on your usb drive into your c:\music\albums folder and it will keep the directory structure so c:\music\albums would look identical to your usb drive when its done
so all u should need is one line of code in your bat file
i've wrote a program to copy the files from usb-stick...
perhaps it should help.
http://tinyurl.com/syzzf
(its written for a german car-pc-board)
Bookmarks