function ExecuteScript

Home  Previous  Next

function ExecuteScript(AScriptFile : string) : boolean;

 

Loads the script text from the text file named AScriptFile and executes it. For the duration of script execution, the operation of the initiating script is suspended. Successful execution returns “true” and failure returns “false” (an error results when the file has not been found or the script contains syntax errors, or when a fatal error occurred during script execution).

 

 

Compatibility:

AVZ 4.34 and later

 

Example:

 

begin

 ExecuteScript('DeleteMalware.txt');

end.

 

Note:

Do not create scripts causing infinite recursion (that is, the primary script executes "script 1", "script 1" executes "script 2", which in turn executes "script 1" resulting in the execution of “script 2” and so forth ad infinitum).
Scripts executed using the ExecuteScript function use a common quarantine folder and can modify common AVZ settings; however, they keep independent lists of deleted or quarantined files keep this in mind when using such functions as ExecuteSysClean or BC_Activate.
This function has been introduced into the script language mostly to organize “manager scripts”, that is, an ideology in which the principal script decides which scripts to run on a specific computer. This is convenient when AVZ is launched centrally on a network.