[ Home | Alpha index | Topic index | Tutorials | Download | Feedback ]

The OS/2 API Project

DosSetDefaultDisk

[ Syntax | Params | Returns | Include | Usage | Structs | Gotchas | Code | Also ]

Syntax

rc = DosSetDefaultDisk( ulDrive );

Parameters

ULONG ulDrive (input)
The number of the drive to set as default drive. (A=1, B=2 etc.)

Returns

APIRET  rc
0       NO_ERROR
15      ERROR_INVALID_DRIVE

Include Info

#define INCL_DOSFILEMGR
#include <os2.h>

Usage Explanation

DosSetDefaultDisk sets the specified drive as the default drive for the process.

Relevant Structures

Gotchas

Sample Code

#define INCL_DOSFILEMGR #include <os2.h> #include <stdio.h> /* For printf */ if(DosSetDefaultDisk(4)) /* Set default drive to D: */ { printf("Can not change default drive to D:\n"); }

See Also

DosQueryCurrentDisk

Author

Oscar Gustafsson - oscar@lysator.liu.se

Additions

Last modified September 21/1996
Please send all errors, comments, and suggestions to: timur@vnet.ibm.com

The OS/2 API Project

DosSetDefaultDisk