BatchDeleteEx

InstallShield 2018 » InstallScript Language Reference

The BatchDeleteEx function deletes lines in a batch file that contain the value specified in szKey.

Note • Before calling BatchDeleteEx, you must call BatchFileLoad to load the file to be modified into memory. After you modify the file, call BatchFileSave to save it to disk.

Do not mix the Ez batch file functions with the advanced batch file functions. After calling BatchFileLoad, you cannot use Ez batch file functions until you have called BatchFileSave to save the file.

Syntax

BatchDeleteEx ( szKey, nOptions );

Parameters

BatchDeleteEx Parameters

Parameter

Description

szKey

Specifies the reference keyword that identifies the line or lines to be deleted.

nOptions

Indicates whether szKey specifies an environment variable in a SET statement or a command. Pass one of the following predefined constants in this parameter:

0—Specifies that szKey is an environment variable in a SET statement. An environment variable is either a predefined identifier (such as PATH, COMSPEC, and LIB), or a user-defined identifier. For example, the following statement would be deleted if the value of szKey was "LIBPATH" and nOptions was set to 0:

SET LIBPATH=C:\Lang\Lib

COMMAND—Specifies that szKey is either a DOS command or a program file name.

Return Values

BatchDeleteEx Return Values

Return Value

Description

0

BatchDeleteEx successfully deleted lines containing the specified value.

< 0

BatchFileLoad was unable to delete lines containing the specified value.

See Also