Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 640
No Idea For Name Avatar asked Dec 20 '22 03:12

No Idea For Name


2 Answers

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.
like image 92
Gray Avatar answered Apr 28 '23 07:04

Gray


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.

like image 38
Eric Brown Avatar answered Apr 28 '23 06:04

Eric Brown