CopyUnique

CopyUnique is a command-line program that copies files from multiple folders into a single folder using sequential numbers as filenames.

This program came about when I wanted to burn audio book MP3 files to a CD.  Since my AIWA-MP32 car stereo plays MP3s, I like to avoid changing discs while driving by ripping a set of audio book CDs to MP3 files and burning them to just one or two MP3 CDs.  The problem I had is that, after ripping the audio book CDs, the directory structure usually looked something like this:

  • \AudioBook
    • \Disc1
      • Track 1.mp3
      • Track 2.mp3
      • Track 3.mp3
      • Track 4.mp3
    • \Disc2
      • Track 1.mp3
      • Track 2.mp3
      • Track 3.mp3
    • \Disc3
      • Track 1.mp3
      • Track 2.mp3
      • Track 3.mp3

Obviously, this directory and filename structure doesn't make it easy to burn all the MP3s to a single folder on a CD. CopyUnique solves this problem by recursively going into each directory and copying the files using a sequential number as the filename. This results in something more manageable like this:

  • \AudioBookCD
    • 01.mp3
    • 02.mp3
    • 03.mp3
    • 04.mp3
    • 05.mp3
    • 06.mp3
    • 07.mp3
    • 08.mp3
    • 09.mp3
    • 10.mp3

As you can see, CopyUnique also compensates for the brain-dead sorting logic of many MP3 players such as mine by ensuring all the filenames are padded with leading zeros to make them equal length.  This keeps the MP3 player from erroneously thinking 1.mp3 should be followed by 10.mp3 instead of 2.mp3.  CopyUnique itself intelligently sorts filenames with numbers in them to ensure the correct file sequence is preserved.

Please let me know if you find this program useful as well as if anything needs to be changed, fixed, or added!

Usage

Usage: CopyUnique.exe [options] source_dir[\*.extension] target_dir
/r Copy folders recursively
/m Move files instead of copying
/s:n Sort files by name
/s:c Sort files by creation date (default)
/s:w Sort files by last write date

For example, to copy all my audio book MP3 files from the above C:\AudioBook directory into C:\AudioBookCD I would use the following command:

CopyUnique /r C:\AudioBook\*.mp3 C:\AudioBookCD

Version History
  • 2/09/2008 - Version 1.2

    Added the ability to move files instead of copy them.

  • 5/02/2005 - Version 1.1

    Added the ability to sort by file creation or last modified dates. Sorting by creation date enables the correct order to be maintained even if the CD ripping program uses incorrect or unpredictable filenames (Windows Media Player...).

  • 4/12/2005 - Version 1.0
Requirements
  • Windows XP, Windows 2000, or Windows Server 2003
  • Microsoft .NET Framework 1.1 (available on Windows Update)
Download