944,045 Members | Top Members by Rank

Ad:
Nov 29th, 2006
0

Assigning Drive Letter in VB6

Expand Post »
Is there a method that VB uses to get the drive letter of the directory where the program files reside witout specifying it explicitly? :rolleyes:
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
PaulCC is offline Offline
2 posts
since Nov 2006
Nov 29th, 2006
0

Re: Assigning Drive Letter in VB6

If I understand correctly. You can use the stored system variables:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Debug.Print Environ("PROGRAMFILES")
  2.  
  3. 'OR if you want just the drive letter you can also use
  4.  
  5. Debug.Print Environ("HOMEDRIVE")
  6.  
  7. 'OR
  8.  
  9. Debug.Print Environ("SYSTEMDRIVE")
Find a large list of these variables here and what they are all about: http://vlaurie.com/computers2/Articles/environment.htm
Last edited by Sentax; Nov 29th, 2006 at 6:44 pm. Reason: Added more information.
Reputation Points: 10
Solved Threads: 2
Newbie Poster
Sentax is offline Offline
18 posts
since Nov 2006
Nov 29th, 2006
0

Re: Assigning Drive Letter in VB6

The path where the project file resides can be gotten (as a string) using App.Path
Reputation Points: 10
Solved Threads: 0
Newbie Poster
PaulCC is offline Offline
2 posts
since Nov 2006
Nov 30th, 2006
0

Re: Assigning Drive Letter in VB6

Hi,

Use

MsgBox "My program Is In drive : " & Left(App.Path,1)

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Communicating with access database..Urgent<:)
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: problems about my data form wizard





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC