Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
_chdrive
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The _chdrive function changes the current working drive to the
drive specified by <drive>. The <drive> argument uses an integer
to specify the new working drive (1=A, 2=B, etc.).
This function changes only the working drive; the chdir function
changes the working directory.
In OS/2 protected mode, the working drive is local to a process
rather than system-wide. When a process terminates, the working
drive is restored to its original value. Under DOS, the new drive
set by the program becomes the new working drive.
Return Value
The _chdrive function returns a value of 0 if the working drive is
successfully changed, or -1 if an error occurs.
-♦-