Click here to Skip to main content
5,790,650 members and growing! (21,684 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Mobile Development » Applications     Intermediate

Command-line utility for PocketPC

By Alexander Shilonosov

RAPI based utility for copying files and folders PC->PocketPC (and vice versa). There is also - "Dir, Del, Db" commands.
VC6, C++, Win Mobile, Mobile, Windows, NT4VS6, Visual Studio, Dev

Posted: 26 Jan 2004
Updated: 26 Jan 2004
Views: 76,000
Bookmarked: 34 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
18 votes for this Article.
Popularity: 4.14 Rating: 3.30 out of 5
3 votes, 16.7%
1
2 votes, 11.1%
2
1 vote, 5.6%
3
3 votes, 16.7%
4
9 votes, 50.0%
5

Introduction

This utility (rcmd.exe) can copy files and folders (with subfolders) to PocketPC or from PocketPC to desktop PC. I integrated this tool into "Send To" menu. And now I am able to copy any file/folder to my device without opening ActiveSync's browser. This tool is also useful for some kind of automation.

This is a command-line Win32 application which uses RAPI to work with PocketPC. To run this utility, you should have ActiveSync installed in Desktop PC.

Windows CE Remote API

With RAPI, you can write data to or read data from a Windows CE-based device remotely with a desktop computer. This API support various functions:

  • System Information Functions

    about memory, power, desktop, stores, password.

  • Database Functions

    retrieving and storing data.

  • File and Directory Management Functions

    creating, deleting files/folders, changing attributes.

  • Registry Management Functions

    retrieving and storing data.

  • Shell Management Functions

    shortcuts, special folders.

  • Window Management Functions

    enumerating, getting properties of windows.

This API also allows to execute applications and call a function from a DLL inside PocketPC. I think it's a great API for automating PocketPC from Desktop.

Using the sources

To build the project, you need to setup eMbedded Visual Tools (or PocketPC SDK), and setup directories in Visual C++ 6.0. Add ActiveSync inc\ and lib\ folders. Use menu Tools -> Options -> directories tab. In my case, I added C:\Windows CE Tools\wce300\MS Pocket PC\support\ActiveSync\inc (and \lib) folders.

The sources consist of a CRapi class and main module. CRapi.cpp has some public methods:

//

// copy files (with subfolders, by mask) between Destop <-> PocketPC.

//

// parameters:

//  par1 - path to copy from 

//  par2 - path to copy to

//

//  The paths may be from Desktop or PockePC

// (but both can not be from one target)

int CRapi::copy(LPCTSTR par1, LPCTSTR par2, LPCTSTR par3, LPCTSTR par4)
...
...

//

// Delete files by mask

//

//

int CRapi::del(LPCTSTR par1, LPCTSTR par2, LPCTSTR par3, LPCTSTR par4)
...
...

//

// Show files and folders

//

// dir c:\*

// dir \temp\*

// dir "\my documents\*" 

//

int CRapi::dir(LPCTSTR par1, LPCTSTR par2, LPCTSTR par3, LPCTSTR par4)
...
...

//

// Rinning application in PPC 

//

int CRapi::run(LPCTSTR par1, LPCTSTR par2, LPCTSTR par3, LPCTSTR par4)
...
...

//

// enumerates DataBases in PPC

//

int CRapi::db(LPCTSTR par1, LPCTSTR par2, LPCTSTR par3, LPCTSTR par4)
...
...

History

  • Dec 2003: Fixed some bugs.
  • Aug 2002: First release.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Alexander Shilonosov



Occupation: Web Developer
Location: Moldova, Republic Of Moldova, Republic Of

Other popular Mobile Development articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 20 of 20 (Total in Forum: 20) (Refresh)FirstPrevNext
GeneralBuffer overunmemberMember 414512821:23 7 Mar '08  
GeneralCopyingmemberfdgf12:20 16 Dec '07  
Generalwhy buffer size is 5006memberAgunJ23:51 27 Aug '07  
QuestionSD card directorymemberugroczkycs4:22 14 Nov '06  
AnswerRe: SD card directorymemberAlexander Shilonosov3:57 15 Nov '06  
Questionpossible to convert to vb .netmemberathinarayanan4:26 2 Nov '06  
GeneralBug fix : memory leak [modified]memberVincent_RICHOMME5:56 10 Jul '06  
GeneralHow to add to "Send to" meu ??memberjulian_hung0:47 10 Jun '06  
GeneralRe: How to add to "Send to" meu ??memberAlexander Shilonosov4:01 15 Nov '06  
GeneralThank you!memberhepan22:11 19 Jan '06  
GeneralHow to avoid memory read error exceptions?memberCarlos Eugênio X. Torres0:37 23 Jun '05  
GeneralRe: How to avoid memory read error exceptions?memberAlexander Shilonosov2:32 23 Jun '05  
GeneralRe: How to avoid memory read error exceptions?memberCarlos Eugênio X. Torres5:24 23 Jun '05  
GeneralRe: How to avoid memory read error exceptions?memberAlexander Shilonosov6:06 23 Jun '05  
Generalcreating directorymemberhadaf90:42 18 Apr '05  
GeneralRe: creating directorymemberAlexander Shilonosov21:17 18 Apr '05  
GeneralRe: creating directorymemberquentinsiraut6:17 19 Apr '05  
GeneralTelnet and RCMDmemberquentinsiraut9:12 15 Apr '05  
GeneralRe: Telnet and RCMDmemberAlexander Shilonosov21:33 15 Apr '05  
GeneralRe: Telnet and RCMDmemberquentinsiraut6:20 19 Apr '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 26 Jan 2004
Editor: Smitha Vijayan
Copyright 2004 by Alexander Shilonosov
Everything else Copyright © CodeProject, 1999-2009
Web13 | Advertise on the Code Project