Command Line

Top  Previous  Next

PDQ Inventory provides a command line interface to access a number of features of the application.

Command Names

All command line operations are executed using PDQInventory in the application's program files folder passing in the name of the command along with parameters. For example this is the command to optimize the database:

PDQInventory OptimizeDatabase

To get a list of all command names that are available run PDQInventory with no parameters.  For the details of a particular command use Help and the name of the command:

PDQInventory Help OptimizeDatabase

The command and parameter names are not case sensitive and can be typed in lower, upper, or mixed case.

Parameters

Parameters are generally passed to a command using the name of the parameter followed by one or more values.  Parameter names always start with a hyphen (-) and are not case sensitive.  Parameter names don't need to be fully typed out, only enough of the name to make it unique among parameters is needed:  -CommandName and -C can both be used with the Help command to specify the command to view.

Parameter Separators

The Windows command line processor (cmd.exe) uses spaces to distinguish different parameters.  To include a parameter that includes spaces, enclose it in double-quotes (").  To include a parameter with double-quotes, add an additional set of quotes, for example:

"This is all one ""parameter"" to the command"

Positional Parameters

Some parameters can have their name omitted and will work based on their position in the parameter list. In the help they are shown with their name surrounded by [] as -CommandName is in the following example.

Help [[-CommandName] <string>]

The Help command can omit -CommandName and the first parameter will be used for the command name.

Optional Parameters

Some parameters are optional and can be left out and a default value will be used instead.  These will be detailed in the help for each command.  Optional parameters are surrounded by square brackets [] in the syntax output for the command.

Flags

Flag parameters are a special type of optional parameter that have no value, they are either on or off.  Simply include the name of the parameter to turn on the flag.

Data Types

Each parameter has a particular type with only certain values being allowed.  The types allowed are:

Type

Description

string

This is the most common type of parameter, it can be any text

integer

A integer number (no decimals) including negative numbers.  Do not include any non numerals such as thousands separators.

date/time

A date and/or time value.  Use any format recognized by the system's international settings.  To ensure compatibility use the ISO 8601 date format, e.g. 2013-28-02T05:30

Multiple Values

Some parameters take multiple values and their syntax will indicate this by putting a + at the end, e.g. string+.  To provide multiple values just add them one after another separated by spaces.  The command will treat all such parameters as multiple values up until the next parameter name.  To include a value that starts with a hyphen (-) precede it with two hyphens (--) to indicate to the command the the parameter is a value and not a name.