The Windows XP Embedded Command-Line Tool

Foreword: This whitepaper, second in our series leading up to the Nov. 1
official launch of Windows XP Embedded SP2 Feature Pack 2007, discusses the
newly redesigned command line scripting tool, offering some history and a
couple of examples where it is particularly useful.

The Windows XP Embedded Command-Line Tool

Improving the developer experience through a command line tool to script XP
Embedded builds, edit configurations, and mine the database

by Matt Kellner
In 2002, Windows XP Embedded Service Pack 1 shipped a command-line tool
called CMI Explorer. This tool was a simple value-add script that provided
some of the functionality also available in Target Designer and Component
Database Manager. The original version of this tool was challenging to use
and poorly documented; and it didn't provide a lot of value to our
customers. Overall, our customers challenged us to update the tool to
better automate their build processes and perform various tasks with it.
This interest in a command-line tool (and particularly scripting
capability) remained high.

When I took over development of CMI Explorer in January 2006, I set out to
understand the most common customer scenarios and requests for our tools.
The most common request was, by far, a way to automate Target Designer;
particularly to be able to make small changes to a configuration and build
it without having to manually work with the graphical user interface (GUI)
every time. Other customers wanted a way to efficiently import their custom
components without having to use Component Database Manager, and many
requested the ability to trace component dependency relationships
(something none of our existing tools provided directly).

After several months of research and development, we released a new version
of this tool, simply called "Windows XP Embedded Command-Line Tool," or
XPECMD for short. XPECMD enables many developer scenarios and can greatly
improve a developer's productivity -- among its top features:
A powerful command-line interface to modify and build configurations

Reduction in overall development time by simplifying the developer
experience

Script through the use of flexible "response files," which can be created
manually or on the fly by automation

Interface to research component dependency relationships

Import into and administer component databases

Here's an example of what you can do with XPECMD: A common task in Target
Designer is to open an existing configuration; add or change a component;
resolve dependencies; then build the resulting runtime image. In TD, this
process can be somewhat slow and cumbersome, and there's really no way to
automate it. If you need to perform the same task across multiple
configuration files, dealing with the GUI can become a serious burden.

In XPECMD, however, you need just a few commands to perform the same task.
For example, say you want to add a new User Account to your configuration.
You can leverage XPECMD's powerful Single-Quote Expression (SQE) syntax to
add a new component instance to your configuration, and the whole process
can be done in just a few easy steps:

This code can run in as little as 10-15 seconds, depending on the
complexity of your runtime. To make it even more convenient, you can write
this into a response file and set it up so it can take parameters for the
config and runtime image paths. Then you can easily automate the process
across multiple files,
running them all as a batch in a fraction of the time it would take to do
all this in TD.

Another useful feature of XPECMD is the ability to trace component
dependencies both directions. Using the DEPTREE and SHOW commands, you can
easily see a component's dependencies - DEPTREE also allows you to see an
entire tree of component dependencies if you so desire. Meanwhile, the
DEPTRACE command allows you to see which components depend on a specific
component. As an example, let's look at the forward and reverse
dependencies of Enhanced Write Filter:

XPECMD has many other ways to improve your productivity, but as I showed in
the few examples above, this utility should enable XP Embedded developers
to be more productive, more easily search for information in their
configurations or in the database, and finally, incorporate the XPe build
process into existing build environments. Be sure to check out the new tool
(included in the Tools Update of Feature Pack 2007 CTP) and the "How To"
document available on the Microsoft Connect site.

You can find more information about the Windows XPe product at its homepage
on MSDN. You can also download a Customer Technical Preview version of FP
2007 from the Microsoft Connect Site -- sign up for the CTP using this
Invitation ID: 123-BC7M-6GVK.

Foreword: This whitepaper, second in our series leading up to the Nov. 1
official launch of Windows XP Embedded SP2 Feature Pack 2007, discusses the
newly redesigned command line scripting tool, offering some history and a
couple of examples where it is particularly useful.

The Windows XP Embedded Command-Line Tool

Improving the developer experience through a command line tool to script XP
Embedded builds, edit configurations, and mine the database

by Matt Kellner
In 2002, Windows XP Embedded Service Pack 1 shipped a command-line tool
called CMI Explorer. This tool was a simple value-add script that provided
some of the functionality also available in Target Designer and Component
Database Manager. The original version of this tool was challenging to use
and poorly documented; and it didn't provide a lot of value to our
customers. Overall, our customers challenged us to update the tool to
better automate their build processes and perform various tasks with it.
This interest in a command-line tool (and particularly scripting
capability) remained high.

When I took over development of CMI Explorer in January 2006, I set out to
understand the most common customer scenarios and requests for our tools.
The most common request was, by far, a way to automate Target Designer;
particularly to be able to make small changes to a configuration and build
it without having to manually work with the graphical user interface (GUI)
every time. Other customers wanted a way to efficiently import their custom
components without having to use Component Database Manager, and many
requested the ability to trace component dependency relationships
(something none of our existing tools provided directly).

After several months of research and development, we released a new version
of this tool, simply called "Windows XP Embedded Command-Line Tool," or
XPECMD for short. XPECMD enables many developer scenarios and can greatly
improve a developer's productivity -- among its top features:
A powerful command-line interface to modify and build configurations

Reduction in overall development time by simplifying the developer
experience

Script through the use of flexible "response files," which can be created
manually or on the fly by automation

Interface to research component dependency relationships

Import into and administer component databases

Here's an example of what you can do with XPECMD: A common task in Target
Designer is to open an existing configuration; add or change a component;
resolve dependencies; then build the resulting runtime image. In TD, this
process can be somewhat slow and cumbersome, and there's really no way to
automate it. If you need to perform the same task across multiple
configuration files, dealing with the GUI can become a serious burden.

In XPECMD, however, you need just a few commands to perform the same task.
For example, say you want to add a new User Account to your configuration.
You can leverage XPECMD's powerful Single-Quote Expression (SQE) syntax to
add a new component instance to your configuration, and the whole process
can be done in just a few easy steps:

This code can run in as little as 10-15 seconds, depending on the
complexity of your runtime. To make it even more convenient, you can write
this into a response file and set it up so it can take parameters for the
config and runtime image paths. Then you can easily automate the process
across multiple files,
running them all as a batch in a fraction of the time it would take to do
all this in TD.

Another useful feature of XPECMD is the ability to trace component
dependencies both directions. Using the DEPTREE and SHOW commands, you can
easily see a component's dependencies - DEPTREE also allows you to see an
entire tree of component dependencies if you so desire. Meanwhile, the
DEPTRACE command allows you to see which components depend on a specific
component. As an example, let's look at the forward and reverse
dependencies of Enhanced Write Filter:

XPECMD has many other ways to improve your productivity, but as I showed in
the few examples above, this utility should enable XP Embedded developers
to be more productive, more easily search for information in their
configurations or in the database, and finally, incorporate the XPe build
process into existing build environments. Be sure to check out the new tool
(included in the Tools Update of Feature Pack 2007 CTP) and the "How To"
document available on the Microsoft Connect site.

You can find more information about the Windows XPe product at its homepage
on MSDN. You can also download a Customer Technical Preview version of FP
2007 from the Microsoft Connect Site -- sign up for the CTP using this
Invitation ID: 123-BC7M-6GVK.