Finding Components in the Database

XPECMD provides a simple syntax for locating components in the database. Referred to as a Single-Quote Expression (SQE), this syntax allows you to look up components using the Display Name or GUID. You can retrieve a single component or instance, or a collection of components or instances. SQE also supports other object types. For more information, type help /SQE at the command prompt.

The SQE syntax is as follows:

'type:querystring'

Note   Components and instances are not the same things. If you need to get information about a component, use the component or components objects to store the result of your query. However, a runtime configuration requires instance objects, which are instances of a component. In some cases, a configuration can have more than one instance of the same component.

The query can be one of the following:

  • A partial display name

    This returns all components that contain your query string.

  • A caret (^) followed by the full display name

    This returns only an exact match.

  • A VIGUID or VSGUID

  • An asterisk (*)

    This returns all components.

The current minimum visibility level affects components and instances returned in a SQE. By default, this level is set to 1000, but you can change this level by using the minvis or mv command:

xpecmd> minvis 100

The following examples show how you can find components in the database.

Example 1: This returns an instance of Internet Explorer.

xpecmd> new myInst Instance
xpecmd> myInst = 'inst:^Internet Explorer'

Example 2: This returns all components that contain Group Policy.

xpecmd> new myCollection Components
xpecmd> myCollection = 'comps:Group Policy'

Example 3: This returns all components in the database.

xpecmd> new myComp = 'comp:{CB6FD864-D64C-4BD7-A55E-DF05F1975711}'   (returns the WMI Core component)
xpecmd> new allComps = 'comps:*'

In each case, the latest revision of each component is returned. This matches the behavior of Target Designer. Optionally, you can specify a specific revision by appending a pipe character (|), an R, and the desired revision number. The following example shows how to do this. This query returns an instance of the SP1 version of Internet Explorer.

xpecmd> new myInst = 'inst:^Internet Explorer|R1507'

To get a collection of all revisions of a component, use an asterisk as the revision number. The following example shows how to do this. This query returns all revisions of Internet Explorer.

xpecmd> new myComps = 'comps:^Internet Explorer|R*'

If you have a number of custom components that have their own specific revision number and you want to retrieve them all at once, the following example shows you how to do this. This query returns all components with revision 5679.

xpecmd> new myStuff = 'comps:*|R5679'

If you have a component with a name containing a single-quote or double-quote character, you must use two of the quote marks ('' or "") together to include the quote in your search expression. The following examples show how to do this.

Example 1: This returns all AC'97 components.

xpecmd> new myComps = 'comps:AC''97'

Example 2: This returns components with a quoted phrase beginning with "wireless".

xpecmd> new myComps = 'comps:""wireless'

Example 3: This expression fails with an "Unterminated Quote" error.

xpecmd> new myComps = 'comps:AC'97'

Example 4: This expression fails with an "Unterminated Quote" error.

xpecmd> new myComps = 'comps:"wireless'

Last updated on Wednesday, October 18, 2006

© 2006 Microsoft Corporation. All rights reserved.