Results 1 to 9 of 9

Thread: Batch file to transfer mp3s from usb drive

  1. #1
    Newbie
    Join Date
    Jun 2005
    Posts
    7

    Batch file to transfer mp3s from usb drive

    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.

  2. #2
    Confusion Master
    Auto Apps:loading...
    Enforcer's Avatar
    Join Date
    Sep 2003
    Location
    If you go down to the woods today, You're sure of
    Posts
    14,617
    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.

  3. #3
    Newbie
    Join Date
    Jun 2005
    Posts
    7
    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?

  4. #4
    Raw Wave
    Join Date
    Jun 2004
    Location
    On the beach
    Posts
    2,223
    You can using Xcopy instead of copy.

  5. #5
    FLAC TheLlama's Avatar
    Join Date
    Jul 2004
    Location
    All over the world
    Posts
    970
    or cp under cygwin

  6. #6
    Confusion Master
    Auto Apps:loading...
    Enforcer's Avatar
    Join Date
    Sep 2003
    Location
    If you go down to the woods today, You're sure of
    Posts
    14,617
    Quote Originally Posted by bnew019
    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?
    Then have a look at my program.

    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.

  7. #7
    Maximum Bitrate Jarrod's Avatar
    Join Date
    Jan 2002
    Location
    Melb, Australia.
    Posts
    475
    I am setting up robocopy to sync my files, VERY powerful command line tool. google it.
    Jarrod - Holden VX S!

  8. #8
    Newbie
    Join Date
    Feb 2005
    Posts
    22
    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

  9. #9
    Newbie
    Join Date
    Apr 2004
    Location
    Koblenz / Germany
    Posts
    5
    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)

Similar Threads

  1. Need help with a batch file
    By djXternal in forum General MP3Car Discussion
    Replies: 1
    Last Post: 11-22-2005, 01:26 AM
  2. Problem: WinXP sets USB drive to read-only
    By d_sellers1 in forum Software & Software Development
    Replies: 4
    Last Post: 10-01-2005, 03:05 PM
  3. Batch file as a shell?
    By jessebs in forum WinNT Based
    Replies: 0
    Last Post: 06-29-2005, 10:05 AM
  4. External USB drive
    By mtmsol in forum General Hardware Discussion
    Replies: 11
    Last Post: 11-27-2001, 05:25 AM
  5. How do I transfer my mp3's
    By brandondere in forum General Hardware Discussion
    Replies: 5
    Last Post: 05-10-2001, 10:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •