GetValidDrivesList

InstallShield 2019 » InstallScript Language Reference

The GetValidDrivesList function retrieves a list of all the drives attached to the target system that meet a certain criterion. This criterion includes the type of drive and the minimum amount of space on the drive. If a drive door is open, the drive name is still inserted into the list.

Syntax

GetValidDrivesList (listID, nDriveType, nMinDriveSpace);

Parameters

GetValidDrivesList Parameters

Parameter

Description

listID

Returns a list of valid drive letters. The string list identified by listID must already have been initialized by a call to ListCreate.

nDriveType

Specifies the type of drive to search for. Pass one of the following predefined constants in this parameter:

-1—Searches for all drive types.
FIXED_DRIVE—Searches only for fixed drives.
REMOTE_DRIVE—Searches only for remote drives. Remote drives are generally located on a network.
REMOVEABLE_DRIVE—Searches only for removable drives. Floppy drives are removable drives.
CDROM_DRIVE—Searches only for CD-ROM drives.

nMinDriveSpace

Specifies the minimum amount of disk space in bytes that must be free on the drive to allow the drive to be included in the return list. If nMinDriveSpace is less than zero, GetValidDrivesList will not check for the minimum space on the drive. This is useful for floppy drives.

Return Values

GetValidDrivesList Return Values

Return Value

Description

0

GetValidDrivesList successfully retrieved the requested list.

< 0

GetValidDrivesList was unable to retrieve the list.

Additional Information

You can specify the type of drive to search for and the minimum amount of disk space that must be available before the drive is listed.
Network mapping drives can be returned as remote drives. GetValidDrivesList might not return all drives on the network. Those drives designated as mapping drives only are returned.

See Also