Skip to content
/ mtpcopy Public

A Windows CLI tool for copying files from/to a portable device via MTP.

License

Notifications You must be signed in to change notification settings

kzmi/mtpcopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mtpcopy

A Windows CLI tool for copying files from/to a portable device via MTP.

This tool calls Windows Portable Devices API using Rust for Windows.

Examples

Copy a local folder to a portable device

mtpcopy copy -R ".\My Music" "My Device:SD Card:\Data\My Music"
  • command: copy
  • flags: -R (recursive)
  • source path: .\My Music
  • destination path: My Device:SD Card:\Data\My Music
    • device name: My Device
    • storage name: SD Card
    • path on the storage: \Data\My Music

Copy a folder from a portable device

mtpcopy copy -R "My Device:SD Card:\Data\My Music" "D:\My Music"
  • command: copy
  • flags: -R (recursive)
  • source path: My Device:SD Card:\Data\My Music
    • device name: My Device
    • storage name: SD Card
    • path on the storage: \Data\My Music
  • destination path: D:\My Music

Mirror local folder to a portable device

mtpcopy copy -M ".\My Music" "My Device:SD Card:\Data\My Music"
  • command: copy
  • flags: -M (mirror)
  • source path: .\My Music
  • destination path: My Device:SD Card:\Data\My Music
    • device name: My Device
    • storage name: SD Card
    • path on the storage: \Data\My Music

List portable device storages

mtpcopy storages
  • command: storages

List files on the portable device storages

mtpcopy list -R "My Device:SD Card:\Data\My Music"
  • command: list
  • flags: -R (recursive)
  • path: My Device:SD Card:\Data\My Music
    • device name: My Device
    • storage name: SD Card
    • path on the storage: \Data\My Music

List files on the portable device storages with the Glob pattern

mtpcopy list "*:SD*:\Pictures\202?\**\*.jpg"
  • command: list
  • path: *:SD*:\Pictures\202?\**\*.jpg
    • device name: * (all devices)
    • storage name: SD* (starts with SD)
    • path on the storage: \Pictures\202?\**\*.jpg (any jpg files )

TODOs

  • unit tests with portable device or mock

About

A Windows CLI tool for copying files from/to a portable device via MTP.

Resources

License

Stars

Watchers

Forks

Languages