Question

I'm using Motorola MC67 (I'm not sure that matter, but it's a portable device) and i want to write a batch script to move files there. the problem is i can't call the device path because it's not mounted and i can't mount it. i couldn't find nothing on google about getting to the device not from the windows GUI. I read somewhere activeSync can sync from portable devices, but that's of no use to me. anyway, i repeat, i need a way to move files from my computer to a portable device that isn't mounted. a way to mount the device will be good too, since i can then access it from batch file

Was it helpful?

Solution

First, you need to download Windows Mobile Developer Power Toys because it contains the cecopy utility, which this solution depends on.

Basically, all you need to do is:

cecopy file.exe dev:\file.exe

Here's the readme for cecopy.

INSTRUCTIONS:
Usage:  CeCopy  [options] <Source_FileSpec>  <Destination>

Options:

    /is                  Copy file even if identical.
    /s                   Include subdirectories, hierarchy reproduced on device.

Arguments:

    Source_FileSpec      File specification denoting the source of the copy.
    Destination          Where files should be copied to.

For the source, wild cards or directory names may be specified, as may be single files.  The destination can be either a directory or a file name, depending on the type of source specified.

By default, an argument is assumed to live on a local file system.  To indicate that either argument denotes a location on a device connected via ActiveSync, prepend 'dev:' to that argument.   To articulate that a local file system is referenced, prepend 'desk:' to the argument.

Examples:
"cecopy readme.txt dev:\readme.txt" copies this readme to the device's root.
"cecopy /s *.* dev:\" copies all files and subfolders of current directory to device's root.  Generates new folders on device as needed.
"cecopy /s *.dll dev:\windows" copies all dlls and dlls in subfolders of current directory to the device's root.  Generates new folders on device as needed.

OTHER TIPS

Well, you can't mount the device per se, but you can access it via the Windows Portable Devices api. There are some application samples here, but they're in C++. There's a scripting interface, but that seems to be limited to the device stage experience, and doesn't really seem to be available from, say, Powershell.

the total commander recognize the device and can be used to transfer files through it, and be used progrematicly

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top