media-device-copier

📱 A Windows command-line utility for copying files from phones and other media devices connected as MTP devices.


Project maintained by drittich Hosted on GitHub Pages — Theme by mattgraham

Media Device Copier

Media Device Copier is a Windows command-line utility for copying files to and from phones and other devices connected via MTP (Media Transfer Protocol).

Use it to:

Table of contents


Features


Requirements


Quick start

1) Show help

MediaDeviceCopier.exe -h

2) List devices

MediaDeviceCopier.exe list-devices
# alias
MediaDeviceCopier.exe l

3) List files in a device folder

MediaDeviceCopier.exe list-files -n "Apple iPhone" -s "Internal Storage\DCIM\100APPLE"

# alias + filter to only jpeg files + print full device paths
MediaDeviceCopier.exe lf -n "Apple iPhone" -s "Internal Storage\DCIM\100APPLE" -f "\.(jpg|jpeg)$" --full-path

4) Download from device to PC

MediaDeviceCopier.exe download-files -n "Apple iPhone" -s "Internal Storage\DCIM\100APPLE" -t "D:\Photos" -r

5) Upload from PC to device

MediaDeviceCopier.exe upload-files -n "Android Device" -s "C:\Documents" -t "Internal Storage\Documents" -r -f "\.pdf$"

Commands

list-devices

Lists all available MTP devices.

Example:

MediaDeviceCopier.exe list-devices

list-files

Lists files in a device folder.

Options:

Usage:

MediaDeviceCopier.exe list-files -n "<Device>" -s "<DeviceFolder>" [-f "<regex>"] [--full-path]

Examples:

# List all files in a device folder
MediaDeviceCopier.exe list-files -n "Apple iPhone" -s "Internal Storage\DCIM\100APPLE"

# List only JPEG files and print full device paths
MediaDeviceCopier.exe lf -n "Apple iPhone" -s "Internal Storage\DCIM\100APPLE" -f "\.(jpg|jpeg)$" --full-path

download-files

Downloads files from an MTP device folder to a Windows folder.

Required options:

Common optional options:

Examples:

# Copy pictures recursively and skip already-copied images
MediaDeviceCopier.exe download-files -n "Apple iPhone" -s "Internal Storage" -t "D:\MyPictureFolder" -r

# Move (download then delete from device) all videos after archiving
MediaDeviceCopier.exe download-files -n "Apple iPhone" -s "Internal Storage\DCIM\100APPLE" -t "D:\Archive" -r --move

# Copy only MP4 files from a flat folder (non-recursive)
MediaDeviceCopier.exe download-files -n "Apple iPhone" -s "Internal Storage\DCIM\100APPLE" -t "D:\Videos" -f "\.mp4$"

# Recursive copy: only subfolders starting with 2025, only JPG/PNG files
MediaDeviceCopier.exe download-files -n "Apple iPhone" -s "Internal Storage" -t "D:\MyPictureFolder" -r -sf "^2025.*" -f "\.(jpg|png)$"

# Force overwrite existing files (disable skip-existing)
MediaDeviceCopier.exe download-files -n "Apple iPhone" -s "Internal Storage\DCIM" -t "D:\Photos" --skip-existing false

upload-files

Uploads files from a Windows folder to an MTP device folder.

Required options:

Common optional options:

Examples:

# Upload only PDFs
MediaDeviceCopier.exe upload-files -n "Android Device" -s "C:\Documents" -t "Internal Storage\Documents" -r -f "\.pdf$"

Filtering

The filtering system uses two independent regex patterns:

  1. Subfolder filters (-sf, --filter-subfolders) are applied during folder recursion before descending into subfolders.
  2. File filters (-f, --filter-files) are applied to the file list within each processed folder.

Notes:


Common behaviors and defaults

MediaDeviceCopier.exe --version

Troubleshooting

Device not found

If you see “Device not found”, run:

MediaDeviceCopier.exe list-devices

Then copy/paste the device name exactly into -n.

Folder not found

Invalid regex

If a filter regex is invalid, the CLI will reject it. Start simple and escape backslashes correctly in your shell.

Unsupported file types

Some device files may not be transferable via MTP; those are reported as skipped.


Architecture (resilient downloads)

MTP transfers can fail for certain files due to device firmware quirks, timing issues, or protocol limitations. MediaDeviceCopier uses a multi-strategy download pipeline and detailed diagnostics to make downloads more resilient.

Implementation details are documented in ARCHITECTURE_MTP_STRATEGIES.md.


License

MIT License. See LICENSE for details.


Contributing

Contributions, issues, and feature requests are welcome!