Thursday, January 25, 2007

Motivation behind the Srego CE ToolPack Command-Line Utilities

The command-line tools that make up the Srego CE Toolpack have fairly long history. Their development was inspired by the need to easily move files back and forth between a desktop computer and a connected Windows CE Device (Pocket PC, Window Mobile). Of course, there are existing ways to accomplish this task. The File Explorer (with the help of AciveSync) provides a nice GUI interface that fully integrates the desktop files with the device’s files all through drag-and- drop manipulation. File Explorer provides very effective ad hoc file manipulation and an easy way to explore files on the device. The File Explorer’s interface is ideal for these tasks, but it is not very good at tasks that will be repeated often, tasks that may include a complex set of actions, tasks that will be scheduled, or any task that is automating some workflow. In the desktop world, we would simply write a script to perform these tasks and leave the File Explorer to what it does best. How do you do perform these tasks on a device? This problem posed an in-house question that needed to be solved for developing and testing applications written for handheld devices. The need to frequently move data files back and forth between the desktop and device resulted in cePush and cePull. In development mode, test files and result files could be shuttled between the desktop and device very easily. At a Command Prompt, the command is entered once, then DOS Key (the up and down arrow traversal of the command history or the F7 command history menu) is used to perform the file moves over and over. For more complex tasks, a .bat file can be created to perform a set of transfers. The batch file can even employ some logic and can be scheduled. The original cePush and cePull were very simple; they had no wild card support and no options. There were later enhanced to provide equivalent functionality found in the Command Prompt's Copy command.

The in-house success with cePush and cePull commands led to the need to create even more utilities that would remove directories on the device (ceMkdir, cdRmdir), delete files on the device (ceDel), and simply see what files are on the device on the device (ceDir). Then the need for moving and copying files on the device to the device (versus from the device to the desktop) was needed (ceMove, ceCopy).

The cePush and cePull utilities were updated to support more synchronization operations (checking time and dates to see if an up-to-date file is already present). With this functionally a new utility was added to update a files timestamp (ceTouch, similar to the UNIX touch utility). The ceJump utility was added to streamline editing files on the device.
With all of these utilities available, it became obvious that the one thing missing from the Command Prompt style-environment was the concept of a current directory. The ceCD utility was added to implement this concept and all of the utilities were modified to utilize a current directory concept which often reduces the lengthy paths that need to be typed (for example \my documents was a commonly typed path for the device and always requires quotes, setting this path to be the current simplifies the command).

The last utility added to the toolpack was the ceReg utility which allows registry modifications from the desktop command-line. It is a simplified version of the Reg utility on the desktop, but it still allows the creation, query, and updating of registry entries on the device.

No comments: