Terminate Subst procedure not working


I making a network adminstration program using Delphi 2.0. Working with
this program
I was very happy to discover a assembler code in the Delphi help file
that would
remove a DOS disk-substitution. However when I write this code I get a
Protection Fault Error. Can anybody explain to me why and what I should
do to make it work?

Jimmy Thomsen
Bergen College

Quote from Delphi:

> [New - Windows 95]
> mov ax, 71aah            ; SUBST
> mov bh, 1                ; Terminate Subst
> mov bl, DriveNum         ; see below
> int 21h
> jc error
> Terminate the association between a path and a drive letter.
> Clears the carry flag if successful. Otherwise, the function sets the carry flag and returns an error value in the AX register.
> DriveNum
> Drive to terminate SUBST. This parameter can 1 for A, 2 for B, and so on. Note that DriveNum cannot be 0 to indicate the default drive.