Creating and using user-defined commands

When using remote commands, you can select from a list of predefined system commands. You can also select from your own user-defined commands, as long as they are in the /hci/server or /hci/usercmds directory.

You can also right-click under a user-defined command folder to create sub-categories, rename a category, or delete a category.

The user-defined category structure is kept in a file named user_cmds.dat and saved to the hci/server folder, which is shared by every client. The actual user-command files are put under the hci/usercmds folder.

Use these guidelines when writing commands using Remote Commands:

  • User commands must not make any assumptions about their working directory.

    They must rely on command-line arguments to specify any directories or files with which to work. The only exception to this is the system directories.

    Because the commands are run in a system shell, expect the standard environment settings to be present in the process environment. Standard environment settings include HCIROOT and HCISITE.

  • Write user commands so that they automatically flush the standard output buffer when it is written to. Otherwise, the Remote Commands tool might not display the output in a timely fashion.

Under certain host platforms, you can run some of the standard shell commands, for example, Is, cp. This is not guaranteed. Do not rely on this functionality to accomplish your work. For full remote shell support, use telnet or a similar remote shell environment.

To use a user-defined command:

  1. Create a command and copy it into hci\usercmds.
  2. Launch the IDE and open the Remote Command tool.
  3. Click List Commands.
  4. Expand the User-Defined Commands node to verify that the command is there.
    If the Select Command dialog box is open before you copy the command to hci\usercmds, then click Refresh on the Select Command dialog box. After this, expand the User-Defined Commands node again.