|
What are Triggers?
Triggers is the term used to indicate the ability of DirMonitor to launch any process when a certain userdefined activity takes place.
For example, you can launch your AntiVirus Scanner when a file is being created in C:\Windows folder. You can even pass the path of that file to your AntiVirus Scanner, so the file will be scanned right away.
How to create a Trigger?
First you'll need to have a Watch on an item. You can set a Watch on a Folder, File, Registry Key or Process. How you can do that, is explained in the Help Files of DirMonitor.
In short I will repeat it here:
In the Main Window, click on the button called Add Folder Watch....

Browse for a Folder and click Add.

Now DirMonitor will Monitor the Folder you've selected. The Folder's been added to the list in the Main Window.

From now on, you can add Triggers to all Folders listed in the Main Window.
To add Triggers to an item in the list, right-click on an item and choose Add Program Trigger.

This will popup the following window:

Just browse for the File that should be loaded. Then check which action should activate that file and click on Add.
Now you can close this window and the Trigger will be saved.
You can also use the Wizards to add Folder Watches and attach Triggers to them.
Please take note that you can attach any DirMonitor Script (*.dms) to a Watch. DirMonitor will then execute that Script.
Dynamic Parameters
Dynamic Parameters are parameters which contain information that's been extracted from DirMonitor. For example, when you attach a Trigger to a Folder Watch, you can launch a file when a file is being modified. Dynamic Parameters enable you to give the path of that file as parameter to the program you launch.
You can use this for example to scan every newly created file in a certain directory.
Here I'll explain how to attach such Dynamic Parameters to a Trigger. I will use the Folder Watch Wizard, which you can find in the menu Wizards.

The Wizard will popup:

The first pages are self-explainatory. I will switch immediately to the 4th page. There you'll need to click on Add Trigger.
On the next page, you can ask for some more information about the Dynamic Parameters. On the bottom of the page you'll find a button you need to click to get the information.

You'll get the following screen:

And this'll give the possible Dynamic Parameters. Just fill in one or more of these in the appropriate input box and click Add File to register the Trigger.

Now you have to select when the Trigger should be activated.

Now the Wizard will return to the page 4. Click on Finish to close the Wizard and add both the Watch as the Trigger(s) to the list of DirMonitor.

And that's all! In this case, DirMonitor will launch the file called ScriptLaunch.exe when a file is being created, modified or deleted in the selected Folder. As parameter, the path of the last modified file is being given (because the Dynamic Parameter %modify% has been used).
All Dynamic Parameters
|
Dynamic Parameter
|
Description
|
|
%1 [or %2, ...]
|
Give the last [last but one, ...] logged file as parameter.
|
|
%create%
|
Give the last created file as parameter.
|
|
%modify%
|
Give the last modified file as parameter.
|
|
%delete%
|
Give the last deleted file as parameter.
|
|
%activate%
|
Give the last activated process as parameter.
|
|
%terminate%
|
Give the last terminated process as parameter.
|
|
|
|
|
%all%
|
All files as a comma separated list as parameter.
|
|
|
|
|
%all create%
|
All created files in a comma separated list as parameter.
|
|
%all modify%
|
All modified files in a comma separated list as parameter.
|
|
%all delete%
|
All deleted files in a comma separated list as parameter.
|
|
%all activate%
|
All activated processes in a comma separated list as parameter.
|
|
%all terminate%
|
All terminated processes in a comma separated list as parameter.
|
Click on one of the chapters to the left of this screen.
|