|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Changes the current working drive.
Number of the new working drive.
The _chdrive function changes the current working drive to the drive specified by drive. The drive parameter uses an integer to specify the new working drive (1=A, 2=B, and so forth). This function changes only the working drive; _chdir changes the working directory.
If drive does not specify a valid drive, the invalid parameter handler is invoked, as described in . If execution is allowed to continue, the function returns -1 and errno is set to EACCES, and _doserrno is set to ERROR_INVALID_DRIVE.
Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003
For more compatibility information, see Compatibility in the Introduction.