Getting the Default Drive 
Author Message
 Getting the Default Drive

Is there a way to get the default drive using the Windows 32 API. I know
GetCurrentDirectory returns the default directory. If I want to use this I
also need the default (current) Drive. (C:,D:,A: etc)

Thanx



Sat, 10 Aug 2002 03:00:00 GMT  
 Getting the Default Drive


Quote:
>Is there a way to get the default drive using the Windows 32 API. I know
>GetCurrentDirectory returns the default directory. If I want to use this I
>also need the default (current) Drive. (C:,D:,A: etc)

>Thanx

Use GetModuleFileName and just strip off whatever part you want.

C'ya,

   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
  ___________________________________   www.basicguru.com
      Vertical Software Solutions



Sun, 11 Aug 2002 03:00:00 GMT  
 Getting the Default Drive
Sure.... use the CURDIR$ function and examine the first letter the
returned string is the drive letter of the default drive.

JFYI, your identical query on the powerbasic  BBS was answered by
several people, and provided you with answers much faster than Usenet
was able to do! (smile!)

Quote:

>Is there a way to get the default drive using the Windows 32 API. I know
>GetCurrentDirectory returns the default directory. If I want to use this I
>also need the default (current) Drive. (C:,D:,A: etc)

>Thanx

Lance
PowerBASIC Support

-------------------------------------------------------------------------
PowerBASIC, Inc.      | 800-780-7707 Sales | "We put the Power in Basic!"
316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com



Sun, 11 Aug 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Default drive for FILEDIALOG ???

2. changing default drives

3. default drive question

4. Get/Set default drive question.

5. Getting Connected Drives Information

6. Pls Help!!!!!!!!!!, a: drive not getting accessed from clipper 5.x in Win XP

7. a: drive not getting accessed from clipper 5.x

8. Getting boot drive?

9. Getting Number of Drives..HOW?

10. Getting boot drive?

 

 
Powered by phpBB® Forum Software