[Overview][Classes][Procedures and functions][Index] Reference for unit 'UTF8Process' (#lazutils)

RunCmdFromPath

Executes a command found in the current PATH environment

Declaration

Source position: utf8process.pp line 54

procedure RunCmdFromPath(

  ProgramFilename: string;

  CmdLineParameters: string

);

Arguments

ProgramFilename

  

Name of the program to execute

CmdLineParameters

  

Command line parameters for the process

Description

RunCmdFromPath is used to execute a command which can be found in the current PATH environment. For example, the following locates and executes the /bin/ls command with the specified arguments:

RunCmdFromPath('ls', '-l /home');
          

An exception will be raised if the program file cannot be located, or cannot be executed.

RunCmdFromPath creates an instance of TProcessUTF8 to execute the program using the specified arguments.

Errors

EFOpenError
Raised with the message in lrsProgramFileNotFound
EFOpenError
Raised with the message in lrsCanNotExecute
The latest version of this document can be found at lazarus-ccr.sourceforge.net.