Creating a command task file

This topic describes how to create CMDTask files that are used to integrate third party management software and other programs with IBM Director.

CMDTask files must reside in the director_install_dir\classes\extensions directory and must have an extension of ".CMDExt". The extension .CMDExt is not case sensitive, however, the prefix of a .CMDExt file name must be all uppercase (for example, TELNET.CMDExt).

When you start IBM Director Console, all files with an extension of .CMDExt in the director_install_dir\classes\extensions directory are processed, and the title of each task, which is specified within the file with the Title parameter, appears as a subtask of the External Application Launch task in the Tasks pane.

For example, if you have a file called TELNET.CMDExt (with Title=telnet command) residing on the IBM Director Server in the directory director_install_dir\classes\extensions, the task label telnet command is displayed as a subtask of the External Application Launch task.

On a Windows platform, you can also create a group of related tasks (one parent with a child tree). For example, you could create the following group:
  1. A parent task with a file name of FILESYSTEM.CMDExt and Title=File System commands
  2. A child task with a file name of FILESYSTEM_1.CMDExt (the "_1" is required) and a) Title=Volume command and b) ParentTaskFilename=FILESYSTEM
  3. A child task with a file name of FILESYSTEM_2.CMDExt (the "_2" is required) and a)Title=Dir command and b) ParentTaskFilename=FILESYSTEM
  4. A child task with a file name of FILESYSTEM_3.CMDExt (the "_3" is required) and a) Title=DiskCopy command and b) ParentTaskFilename=FILESYSTEM

As noted in the example, you must append _n to the name of each child task file, and include both the Title and ParentTaskFilename parameters in each file. Note that when you launch a parent task, any child task beneath the parent task is not executed. The parent-child relationship is only in display mode, not in execution mode.

The task titles are sorted within a group. For example, the tasks specified in the examples would display in the following order:

External Application Launch
    File System commands
        Dir command
        DiskCopy command
        Volume command
    telnet command

To refresh the list of subtasks, right-click the External Application Launch task, and then click Refresh.

To restrict the use of a subtask to specific users, use the Task Access menu options under User Administration.

.CMDExt file parameters:

註: An * indicates parameters that you are strongly encouraged to set. Parameters and values are case sensitive.
Parameter name Description Value information
Title* Title of the task or NLS key for the title that will appear as a subtask of External Application Launch It is recommended that you set this parameter. If not set, the base file name of the .CMDExt file is used.
ResourceBundle NLS bundle used for Title  
ParentTaskFilename When creating a child task file, the name of the parent task file

Specify this parameter only if you are creating a child task.

Specify the file name of the parent task without the .CMDExt extension. For example:

ParentTaskFilename=FILESYSTEM

The task label for the child task appears below the task label for the parent task. The existence of the ParentTaskFilename is checked.

CommandString.Windows* The command string to be executed on a Windows system.

Important: .CMDExt files use java properties file formatting; thus, any backslash must be coded as a double backslash. Environment variable values should have only one backslash. For example:

dir c:\\*exe /s

CommandString.Unix* Command string to be executed on a UNIX/Linux system

Important: .CMDExt files use java properties file formatting; thus, any backslash must be coded as a double backslash. Environment variable values should have only one backslash.

Cwd.Windows The path name of the current working directory on a Windows system Specify only if the command needs to start in a specific directory.
Cwd.Unix The path name of the current working directory on UNIX/Linux systems Specify only if the command needs to start in a specific directory.
CheckFileExists The name of a file that is required to exist to execute your command successfully.

This file is optional and is assumed to be in the current working directory (Cwd).

Reminder: Any backslash must be coded as a double backslash.

ShellRequired Indicates whether a shell window is required.

Specify one of the following values:

true
Shell window is required.
false
Shell window is not required (default).
Icon.Small The path to the CMDTask's small icon, which appears next to the task label in the subtasks list under External Application Launch

This path assumes you are in director_install_dir/classes.

Start the path with a slash (/) before typing in any path name. For example, if the icon is located under director_install_dir/classes/icondir, the value for the parameter is:

Icon.Small=/icondir/iconname.gif

Icon.Large The path to CMDTask’s large icon, which appears in the Tasks pane on Director console.

This path assumes you are in director_install_dir/classes.

Start the path with a slash (/) before typing in any path name. For example, if the icon is located under director_install_dir/classes/icondir, the value for the parameter is:

Icon.Large=/icondir/iconname.gif

Targeted Indicates whether the CMDTask needs to be dragged and dropped onto a target system.

Specify one of the following values:

none
Task can be opened using a right mouse click or double-clicked
one
Task needs to be dragged and dropped onto a target system (default).
none|one
Task can be opened or dragged and dropped onto a target system.
Timeout The number of seconds to wait for the task command to return after execution. Specify a numeric value from 1 through 60. Default is 5 seconds. Maximum value allowed is 60 seconds.

Examples for CommandString.Windows and CommandString.Unix:

These examples are provided as common usages to help avoid syntax confusion. Use these examples as guidance for creating command strings.

Example 1:

Open a telnet session and hold the window open while users are typing in their userid and password. With the -hold option, you also receive an error message if the telnet command is not executed successfully.

On UNIX/Linux:

CommandString.Unix = xterm -e -hold telnet $CMDTASK_IP_ADDRESS0

On Windows:

CommandString.Windows = telnet %CMDTASK_IP_ADDRESS0%

Example 2:

Net use into a system

CommandString.Windows = net use * \\\\%CMDTASK_COMPUTERNAME%\\c$ /u:userid pwd

(C) Copyright IBM Corporation 1999,2005. All Rights Reserved.