Previous Topic: EnumValueNext Topic: Exit


Execute

Execute

Exceutes an executable or dll. If the Execute command is unable to find the file or the dll to call, the function returns false.

First parameter:

The first parameter is the path to what to execute. If the path is to a dll, then the API function must be after two colons. The format of the dll call is PATH::APIFunctionName. The Execute command for dll only looks for calls in two types of functions:

    int FunctionName();
    int FunctionName( const char * );
Second parameter:

If the call takes the command line arguments, enter the arguments or enter an empty string.

Third parameter:

A Boolean value that indicates whether the script waits for an Executable to complete. This parameter is ignored for dll calls.

Examples:
/*executes notepad with the following file, myfile.txt and waits for the process to end.*/
Execute( "c:\\windows\\notepad.exe", "myfile.txt", true );

/*executes notepad without parameters and waiting.*/
Execute( "c:\\windows\\notepad.exe" );

/* makes a call into the dll with parameters*/
Execute( "c\\windows\\Somelib.dll::CheckNetwork", "000d1");

**Note the format for dll PATH::APIFunctionName