Bat file execution from rule action

This sample shows how a plug-in in the Event Server can work together with the XProtect rule system.

The plug-in will execute one of the defined batch files, as a result of a rule. In the configuration of the rule, all batch files (*.BAT) under the plug-ins sub-folder 'BatFiles' are selectable as a final action by any rule.

The BAT file is launced with 3 or more parameters:

The sample.bat file contains:

Batch execution includes a loop to display information about multiple cameras.

The content of the MIPPlugins\BatAction folder:

The *.bat files need to be placed with the plugin, under the 'BatFiles' folder.

A sample rule configured to execute the 'sample.bat' file.

With this example the output file ("C:\ProgramData\Milestone\execute.log" as used by the Sample.bat) contains:

Log output seen in the resulting log file.

The sample demonstrates

Using

Environment

Visual Studio C# project