Skip to content

An application that copies all data from USB drives to a folder, when they are plugged in.

License

Notifications You must be signed in to change notification settings

UnexomWid/usb-duplicator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About .Net Framework 4.5

USB Duplicator is an application that copies all data from USB drives to a folder, when they are plugged in.

License License: MIT

USB Duplicator was created by UnexomWid. It is licensed under the MIT license.

Disclaimer

By using USB Duplicator, you agree to the following:

USB Duplicator should NOT be used for any malicious purposes. It was created to be used as a backup solution for personal USB drives.

I am NOT responsible for any type of misuses and/or damages done by this software, and I cannot be held responsible for your actions, whether or not they are malicious. Use this software at your own risk and responsibility.

Releases

Note: versions with the suffix R are considered stable releases, while those with the suffix D are considered unstable.

v2.0R - September 4, 2019

USB Duplicator

USB Duplicator listens for drive activity. When a USB drive is plugged in, the application begins copying all files from the drive to the working directory, in a directory with the following name:

[{ID}_{DAY}-{MONTH}-{YEAR}_{HOUR}-{MINUTE}-{SECOND}-{MILLISECOND}]{DRIVE_NAME}

Where:

  • {ID} - An arbitrary ID that is used to minimize the chances of 2 drives being duplicated in the same directory.
  • {DAY} - The current day
  • {MONTH} - The current month
  • {YEAR} - The current year
  • {HOUR} - The current hour
  • {MINUTE} - The current minute
  • {SECOND} - The current second
  • {MILLISECOND} - The current millisecond
  • {DRIVE_NAME} - The drive name, or USB Drive if the drive doesn't have a name

To see what arguments the application accepts, launch it with the -h or --help flag (e.g. usbd.exe -h), or read below.

Note that It might take a few seconds for the application to detect the USB Drive.

Whitelist & Blacklist

By default, USB Duplicator copies files from all USB drives when they are plugged in. However, you can specify which drives you wish to copy from.

Marked Drives

A drive is considered marked if it contains a file called usbd in the root (e.g. if the drive letter is F:\, then the drive will be considered marked if the file F:\usbd exists).

The marking file doesn't need to have any content, it just needs to exist.

Whitelist

You can switch to the whitelisting mode by launching the application with the -w or --whitelist flag. In this mode, only marked drives will be duplicated. Unmarked drives will be ignored.

This is useful when you have specific drives that you want to back up.

Blacklist

You can switch to the blacklisting mode by launching the appliation with the b or --blacklist flag. In this mode, only unmarked drives will be duplicated. Marked drives will be ignored.

This is useful when you have specific drives that you don't want to back up.

Working Directory

The default working directory is the directory where the application is launched from.

To change it, simply launch the application with the desired working directory as an argument:

usbd.exe "D:/path/goes/here"

usbd.exe -b "D:/path/goes/here"

usbd.exe "D:/path/goes/here" --whitelist

If the path contains spaces, it must be wrapped in quotes.

If the path contains spaces and it isn't wrapped in quotes, only the first space-less string will be considered as the path (e.g. usbd.exe path/with spaces/goes/here will launch the application with the current directory set to "path/with").

If multiple whitelist/blacklist flags are passed, the last one will be used (e.g. usbd.exe -w -b -w "path/goes/here" -b will launch the application with blacklist mode enabled and with the current directory set to "path/goes/here").

Silent Mode

By default, USB Duplicator logs all information in a console. However, if you don't want the application to open a console, and instead to work silently in the background, you can:

  • use the silent version, provided in each release
  • compile the code with the "SILENT" conditional compilation symbol

Compiling the Code

You can compile the code using any tools you want. However, below you'll find an easy way to do it. For this tutorial, Visual Studio 2019 is used, but other versions should work just fine. You can compile to any platform (x86/x64).

Release

Select the Release configuration, and the Console Application output type (Project->Properties->Application).

Configuration: Release, Output Type: Console Application

You can also choose the Windows Application output type, if you want the application to have a separate console window all the time.

Release (Silent)

Select the Release (Silent) configuration, and the Windows Application output type (Project->Properties->Application).

Configuration: Release (Silent), Output Type: Windows Application

About

An application that copies all data from USB drives to a folder, when they are plugged in.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages