Function 0Eh Set Default Drive

mov dl, DriveNumber ;drive (0 = A, 1 = B, 2 = C, etc.)

mov ah, 0Eh ;Set Default Drive

int 21h

mov LogicalDrives, al ;number of logical drives

Set Default Drive (Function 0Eh) sets the specified drive to be the default drive and returns a count of the logical drives in the system.

Parameter

DriveNumber

Specifies the number of the drive to be made the default drive (0 = A, 1 = B, 2 = C, and so on).

Return Value

The AL register contains the number of logical drives in the system. This number includes floppy disk drives, RAM disks, and logical drives on any hard disks in the system.

Comment

The number of logical drives in the system is not necessarily the same as the number of physical drives. In addition, the number of logical drives returned may not map directly to drive letters. For example, if the function returns 5, drives A, B, C, D, and E are not necessarily valid drive letters.

See Also

Function 19h Get Default Drive
Function 3Bh Change Current Directory