Documentation
Back to website >

ExecuteFile (Pascalscript)

Description

This function executes an external program.

Syntax

function ExecuteFile(const Filename: String; const Parameter: String): boolean;

Arguments

The"Filename" parameter specifies the name of the program to be executed, including the drive and path specifications. The second parameter"Parameter" is passed to the called program.

Example

begin
  ExecuteFile('C:\Windows\System32\notepad.exe',
             'C:\autoexec.bat');
end

Rules to understand the script can be found here.

In this example, Notepad, the simple Windows text editor from the Windows\System32 directory, is started. The file to be edited, in this case the file Autoexec.bat, is passed to the"Notepad" program as a parameter.