If you want a Perl script to run as a custom command on Microsoft Windows, you must prefix the script name with the complete path to Perl. The management server already has a directory containing the Perl executable inside the folder

%JBOSS4_DIST%\server\appiq\remoteScripts\perl\bin. You would prefix the script name as follows:

.\perl\bin\perl myscript.pl

where

.\perl\bin\ is the directory containing the Perl executable in the RemoteScripts directory perl is the executable

myscript.pl is the script you want to run.

Adding a Custom Command

Before adding a custom command, be sure you are aware of the considerations listed in Important Considerations” on page 292.

To add a custom command:

1.Right-click an element in System Manager.

2.Select Custom Commands > Set Up Custom Commands from the menu.

3.Optional: If you plan to use a command to activate a file, such as a script, the file must be uploaded to the management server, as follows:

a.In the Custom Command Setup window, click Browse to find the file containing the custom command.

b.Click Open, and then click Upload to server. The file is saved on the management server.

4.Click the Add Command button in the upper-right corner of the window.

5.In the Add Custom Command window, enter a name for the command in the Name box, for example, backup command.

6.In the Description box, enter a description, for example, This command activates a script that backs up an element.

7.In the Command Line box, enter a command.

This could be a command required to start a script, for example:

myscript.bat

The remote console automatically becomes inactive once the command finishes.

Windows only: If you want the remote console to stay open, prefix the command with the following:

cmd /k

For example:

cmd /k dir

The file is appended to the command line.

Optional: If you plan to use a file in the command, select the file from the Files menu, and then click Append To Command Line.

294 Viewing Element Topology and Properties