Next Topic

Previous Topic

Book Contents

executeShellCommand()

Note: A No Approved Shell Command message displays in the Choose the command to execute in a command shell drop-down list if no SQL commands have been manually added to the Kaseya Server, as described below.

Executes a shell command on the Kaseya Server from the following file locations.

Shell commands stored in these locations are formatted as XML files and can have any filename. You can have multiple commands in one XML file. You can also have multiple XML files.

Example

The XML should be structured like the following example, which includes 2 shell commands.

<?xml version="1.0" encoding="utf-8" ?>
<shellCommandList>
	<shellCommandDef label="Shell Command 1" commandToExecute="echo hello" waitForCompletion="true" sendOutputToLog="true" outputFile="c:\temp\fromcmd.log" outputVariable="" />
	<shellCommandDef label="Shell Command 2" commandToExecute="echo hello" waitForCompletion="true" sendOutputToLog="true" outputFile="c:\temp\fromcmd2.log" outputVariable="" />
</shellCommandList>

Definitions

At least one of the following is required. If both are filled in outputFile has precedence.