How can i move files to a portable device using batch in windows7

No Idea For Name picture No Idea For Name · Jul 2, 2013 · Viewed 8.7k times · Source

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

Answer

Gray picture Gray · Jul 12, 2013

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.