p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_components thread: Re: Common Dialog


Message #1 by kveeram@h... on Thu, 21 Mar 2002 23:37:52
Hi Roni Schuetz,

  The following code will help you to find out which drive is CD-ROM:
  Different Drive Types :
    1 - Floppy Disk 
    2 - Hard Disk 
    3 - Map Drives
    4 - CD ROM Drive
=======================================================================
    Set fs = CreateObject("Scripting.FileSystemObject")
    For Each Drive In fs.Drives
        If Drive.DriveType = 4 Then
            MsgBox "CD Rom Drive is : " & Drive
        End If
    Next
========================================================================

 Wish you all the best

Regards
Veera R Ponna



> Hello,
> 
> I have a little problem with the following code; 
> I must change it so, that the Common Dialog is open 
> in a specific folder in the CD - Rom.
> 
> How can I select the CD-Rom drive letter? 
> Its changed from PC to PC . . .
> 
> Can anywhere help me with it?
> 
> Regards,
> Roni Schuetz
> 
> 
> CODE:
> ===============================================================
> Private Function getName()
>   Dim strPath As String
>   Dim resUser As Integer
>   
>   CommonDialog1.Filter = "ALL Files (*.*)|*.*"
>   CommonDialog1.ShowOpen
>   If CommonDialog1.FileName <> "" Then
>       strPath = CommonDialog1.FileName
>       resUser = MsgBox(strPath, vbOKCancel, "Selcted File")
>       If resUser = 2 Then
>         Exit Function
>       Else
>         Shell strPath, vbNormalFocus
>       End If
>   End If
> End Function
> ===============================================================

  Return to Index