CreateDir

InstallShield 2014 » InstallScript Language Reference

The CreateDir function creates one or more subdirectories on the target drive. You can use a path that contains subdirectories on more than one level, such as C:\Programs\Winapps\Myapp. If any subdirectory in the path does not exist, CreateDir creates it. For example, if neither C:\Programs\Winapps nor C:\Programs\Winapps\Myapp exists, CreateDir creates both subdirectories.

Caution: CreateDir fails under the following conditions:

The path is illegal.
The drive or any subdirectory in the path is write-protected.
The drive name is invalid.
You do not have network privileges to create subdirectories.

Syntax

CreateDir ( szDirPath );

Parameters

CreateDir Parameters

Parameter

Description

szDirPath

Specifies the fully qualified path of the subdirectory to create. Separate each level in the path with a backslash by using the backslash escape character (\\).

Return Values

CreateDir Return Values

Return Value

Description

0

Indicates either that the function successfully created the specified directory on the target drive or that the specified directory already exists.

< 0

Indicates that the directory does not already exist and that the function was unable to create it. You can obtain the error message text associated with a large negative return value—for example, -2147024891 (0x80070005)—by calling FormatMessage.

See Also