BatchFileLoad

InstallShield 2016 » InstallScript Language Reference

The BatchFileLoad function loads a copy of the specified batch file into memory so that other advanced batch file functions can be called to operate on the file. Specify the name of the batch file you want to edit in szBatchFile or pass a null string ("") in szBatchFile to edit the default batch file, which is set initially by InstallShield to the bootup Autoexec.bat file used by the system.

Note that you can call BatchFileLoad to create a new batch file. To do so, pass in szBatchFile the name of a file that does not exist. Then call other batch functions to edit the new file. Finally, call BatchFileSave to save the new file to disk.

Note • Before using any of the advanced batch file functions, 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. To obtain the fully qualified file name of the batch file that will be used by default in the installation script, call BatchGetFileName. To specify a different batch file to be used by default in the installation script, call BatchSetFileName.

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

BatchFileLoad ( szBatchFile );

Parameters

BatchFileLoad Parameters

Parameter

Description

szBatchFile

Specifies the fully qualified name of the batch file to load into memory. To load the current default batch file, pass a null string (""). If you specify a file in this parameter, that file becomes the default batch file. After calling this function, you can use all of the advanced batch file functions to manipulate this file.

To create a new batch file with BatchFileLoad, pass in szBatchFile the name of a file that does not exist. Then call other batch functions to edit the new file.

Return Values

BatchFileLoad Return Values

Return Value

Description

0

BatchFileLoad successfully initialized the batch file buffer. If szConfigFile specified an existing batch file, the file was loaded into the buffer; otherwise, an empty buffer was created.

< 0

BatchFileLoad was unable to initialize the batch file buffer.

See Also