Jump to content

DosSetDefaultDisk

From EDM2
Revision as of 18:59, 29 June 2012 by Martini (talk | contribs) (Created page with "==DosSetDefaultDisk== ===Syntax=== rc = DosSetDefaultDisk( ''ulDrive'' ); ===Parameters=== ; ULONG ''ulDrive'' (input) : The number of the drive to set as default drive. (A=1...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

DosSetDefaultDisk

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