Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find default Hard-Drive

Status
Not open for further replies.

Helen1greece

Technical User
Jun 4, 2003
85
GR
Is there a way to find the letter of the default Hard-Drive through VB source code? Can somebody give me an example code?
 
Do you mean the drive that the your program resides on or the actively partitioned drive?
 
what is your choice ??? ... i'm so confused.

----------------------------------
[daftywork : work 4 everyone.]
>>
 
If you want to know the drive letter of where YOUR application has started from the use this code:

Dim ProgDrive as string
Dim ProgPath as string

ProgPath = App.Path
ProgDrive = Left$(ProgPath,1)
OR
ProgDrive = Left$(App.Path,1)

The built in procedure App.Path will always supply the full path to where your application is started from. With this information, pulling the first character form the returned string (using Left or Left$) will give us the drive letter.

Hope this helps...


===========================
Life is like a box of BASIC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top