Finding application path 
Author Message
 Finding application path

Hi...I want to find the path of a CD containing jpeg files after the user has
intalled the program on a remote machine, however this CD rom drive letter could be "D E F"  or
what ever the user has set this drive letter to be.
The program I have written with VB6 needs to be able to find this drive and path after the
user has clicked on a lable that will direct them to a jpeg file on this unknown cd rom drive letter.

thanks.....Rob



Tue, 27 Aug 2002 03:00:00 GMT  
 Finding application path

Quote:

>Hi...I want to find the path of a CD containing jpeg files after the =
>user has=20
>intalled the program on a remote machine, however this CD rom drive =
>letter could be "D E F"  or=20
>what ever the user has set this drive letter to be.
>The program I have written with VB6 needs to be able to find this drive =
>and path after the=20
>user has clicked on a lable that will direct them to a jpeg file on this =
>unknown cd rom drive letter.

Go to my web page and download GETDRVS.ZIP for sample code to identify the
CDROM drive on the user's system.

Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner



Tue, 27 Aug 2002 03:00:00 GMT  
 Finding application path
If you wish to enumerate all the CD's on the system (remember, there can be,
and frequently are, more than one CD in systems now-a-days), consider the
following:

Private Declare Function GetDriveType Lib "kernel32" _
                Alias "GetDriveTypeA" _
               (ByVal sDrive As String) As Long

Private Sub Command1_Click()
  On Error Resume Next
  For x = Asc("c") To Asc("z")
    If GetDriveType(Chr$(x) & ":") = 5 Then
      Debug.Print Chr$(x)
    End If
  Next
End Sub

where the above is pasted into a Form's code window, clicking a
CommandButton named Command1 is assumed to kick off the code and where you
will replace the Debug.Print with whatever code you actually need.

In case you want to expand upon the above, the possible Return Values from
the GetDriveType function are:

2     Removable Disk Drive
3     Fixed Hard Disk Drive
4     Network Drive
5     CD ROM Drive
6     Ram Disk

Rick


Hi...I want to find the path of a CD containing jpeg files after the user
has
intalled the program on a remote machine, however this CD rom drive letter
could be "D E F"  or
what ever the user has set this drive letter to be.
The program I have written with VB6 needs to be able to find this drive and
path after the
user has clicked on a lable that will direct them to a jpeg file on this
unknown cd rom drive letter.

thanks.....Rob



Wed, 28 Aug 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Finding Application path of VB .Net project

2. Finding the application path

3. Find path to application

4. How to Find Installed Application Path

5. Finding default file type application path

6. Setting / finding path to an Application

7. Finding the path to the application

8. Finding an application's executable name and path

9. Long Path Names give Runtime error 76 - Path not found

10. Setting the path to the path of the current application

11. using application path (app.path)

12. Application Setup Wizard Says D:\<path>\D:\<path>\target.exe

 

 
Powered by phpBB® Forum Software