Click here to Skip to main content
6,595,444 members and growing! (16,317 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, Win Mobile, Mobile, Dev
Posted:26 Jan 2004
Views:85,840
Bookmarked:38 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
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


Member

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

Other popular Mobile Development articles:

  • Writing Your Own GPS Applications: Part 2
    In part two of the series, the author of "GPS.NET" teaches developers how to write GPS applications suitable for the real world by mastering GPS precision concepts. Source code includes a working NMEA interpreter and sample high-precision application in C# and VB.NET.
  • Writing Your Own GPS Applications: Part I
    What is it that GPS applications need to be good enough to use for in-car navigation? Also, how does the process of interpreting GPS data actually work? In this three-part series, I will cover both topics and give you the skills you need to write a commercial-grade GPS application.
  • Learn How to Find GPS Location on Any SmartPhone, and Then Make it Relevant
    A step by step tutorial for getting GPS from any SmartPhone, even without GPS built in, and then making location useful.
  • iPhone UI in Windows Mobile
    It's an interface that works with transparency effects. As a sample I used an interface just like the iPhone one. In this tutorial I am explaining how simple is working with transparency on Windows Mobile.
  • Pocket 1945 - A C# .NET CF Shooter
    An article on Pocket PC game development
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 21 of 21 (Total in Forum: 21) (Refresh)FirstPrevNext
GeneralThanks PinmemberAlexander Gorshkov7:43 17 Jan '09  
GeneralBuffer overun PinmemberMember 414512821:23 7 Mar '08  
GeneralCopying Pinmemberfdgf12:20 16 Dec '07  
Generalwhy buffer size is 5006 PinmemberAgunJ23:51 27 Aug '07  
QuestionSD card directory Pinmemberugroczkycs4:22 14 Nov '06  
AnswerRe: SD card directory PinmemberAlexander Shilonosov3:57 15 Nov '06  
Questionpossible to convert to vb .net Pinmemberathinarayanan4:26 2 Nov '06  
GeneralBug fix : memory leak [modified] PinmemberVincent_RICHOMME5:56 10 Jul '06  
GeneralHow to add to "Send to" meu ?? Pinmemberjulian_hung0:47 10 Jun '06  
GeneralRe: How to add to "Send to" meu ?? PinmemberAlexander Shilonosov4:01 15 Nov '06  
GeneralThank you! Pinmemberhepan22:11 19 Jan '06  
GeneralHow to avoid memory read error exceptions? PinmemberCarlos Eugênio X. Torres0:37 23 Jun '05  
GeneralRe: How to avoid memory read error exceptions? PinmemberAlexander Shilonosov2:32 23 Jun '05  
GeneralRe: How to avoid memory read error exceptions? PinmemberCarlos Eugênio X. Torres5:24 23 Jun '05  
GeneralRe: How to avoid memory read error exceptions? PinmemberAlexander Shilonosov6:06 23 Jun '05  
Generalcreating directory Pinmemberhadaf90:42 18 Apr '05  
GeneralRe: creating directory PinmemberAlexander Shilonosov21:17 18 Apr '05  
GeneralRe: creating directory Pinmemberquentinsiraut6:17 19 Apr '05  
GeneralTelnet and RCMD Pinmemberquentinsiraut9:12 15 Apr '05  
GeneralRe: Telnet and RCMD PinmemberAlexander Shilonosov21:33 15 Apr '05  
GeneralRe: Telnet and RCMD Pinmemberquentinsiraut6: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
Web15 | Advertise on the Code Project