enumerate cd-rom drives 
Author Message
 enumerate cd-rom drives

Hi,

I'm developing a photo archive application for districbution to unknown
machines.

Can anyone point me where to find some direction how to enumerate cd-roms on
a system in vba?

Thanks for any help



Sun, 10 Oct 2004 07:42:47 GMT  
 enumerate cd-rom drives
Set a reference to the scripting runtime dll: SCRRUN.DLL
Use the Object Browser to inspect the methods/properties.

Sample sub:

CDs are type = 4

Public Sub ShowDrives()
   'with a reference set...
   Dim fso As Scripting.FileSystemObject
   Dim oDrive As Scripting.Drive
   Set fso = CreateObject("Scripting.FileSystemObject")

   For Each oDrive In fso.Drives
      Debug.Print oDrive.DriveLetter, oDrive.DriveType
   Next

   Set oDrive = Nothing
   Set fso = Nothing
End Sub

Public Sub ShowDrives2()
   'without a reference set...
   Dim fso As Object
   Dim oDrive As Object
   Set fso = CreateObject("Scripting.FileSystemObject")

   For Each oDrive In fso.Drives
      Debug.Print oDrive.DriveLetter, oDrive.DriveType
   Next

   Set oDrive = Nothing
   Set fso = Nothing
End Sub

Steve


Quote:
> Hi,

> I'm developing a photo archive application for districbution to unknown
> machines.

> Can anyone point me where to find some direction how to enumerate cd-roms
on
> a system in vba?

> Thanks for any help



Sun, 10 Oct 2004 08:08:21 GMT  
 enumerate cd-rom drives
Brilliant! Thanks

Quote:

> Set a reference to the scripting runtime dll: SCRRUN.DLL
> Use the Object Browser to inspect the methods/properties.

> Sample sub:

> CDs are type = 4

> Public Sub ShowDrives()
>    'with a reference set...
>    Dim fso As Scripting.FileSystemObject
>    Dim oDrive As Scripting.Drive
>    Set fso = CreateObject("Scripting.FileSystemObject")

>    For Each oDrive In fso.Drives
>       Debug.Print oDrive.DriveLetter, oDrive.DriveType
>    Next

>    Set oDrive = Nothing
>    Set fso = Nothing
> End Sub

> Public Sub ShowDrives2()
>    'without a reference set...
>    Dim fso As Object
>    Dim oDrive As Object
>    Set fso = CreateObject("Scripting.FileSystemObject")

>    For Each oDrive In fso.Drives
>       Debug.Print oDrive.DriveLetter, oDrive.DriveType
>    Next

>    Set oDrive = Nothing
>    Set fso = Nothing
> End Sub

> Steve



> > Hi,

> > I'm developing a photo archive application for districbution to unknown
> > machines.

> > Can anyone point me where to find some direction how to enumerate
cd-roms
> on
> > a system in vba?

> > Thanks for any help



Sun, 10 Oct 2004 10:05:14 GMT  
 enumerate cd-rom drives
Actually, while that works, relying on the Scripting library isn't the most
robust approach.

Instead, check out http://www.mvps.org/access/api/api0003.htm at Dev
Ashish's "The Access Web" for an API-based solution that doesn't require any
additional references.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele


Quote:
> Brilliant! Thanks


> > Set a reference to the scripting runtime dll: SCRRUN.DLL
> > Use the Object Browser to inspect the methods/properties.

> > Sample sub:

> > CDs are type = 4

> > Public Sub ShowDrives()
> >    'with a reference set...
> >    Dim fso As Scripting.FileSystemObject
> >    Dim oDrive As Scripting.Drive
> >    Set fso = CreateObject("Scripting.FileSystemObject")

> >    For Each oDrive In fso.Drives
> >       Debug.Print oDrive.DriveLetter, oDrive.DriveType
> >    Next

> >    Set oDrive = Nothing
> >    Set fso = Nothing
> > End Sub

> > Public Sub ShowDrives2()
> >    'without a reference set...
> >    Dim fso As Object
> >    Dim oDrive As Object
> >    Set fso = CreateObject("Scripting.FileSystemObject")

> >    For Each oDrive In fso.Drives
> >       Debug.Print oDrive.DriveLetter, oDrive.DriveType
> >    Next

> >    Set oDrive = Nothing
> >    Set fso = Nothing
> > End Sub

> > Steve



> > > Hi,

> > > I'm developing a photo archive application for districbution to
unknown
> > > machines.

> > > Can anyone point me where to find some direction how to enumerate
> cd-roms
> > on
> > > a system in vba?

> > > Thanks for any help



Mon, 11 Oct 2004 06:49:45 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. check is there a CD ROM in the CD drive

2. Use 2nd CD-ROM drive to play CD Audio

3. Checking Whether Drive is a CD ROM Drive

4. Retrieving drive letter for user's cd-rom drive

5. How to determine if a drive is a CD-ROM drive

6. Determining if a Network Drive is a CD-ROM drive

7. Determining if a Network Drive is a CD-ROM drive

8. Accessing file from one CD-ROM in a multiple CD-ROM system

9. How to change Multi Media CD-ROM in two or more CD-ROM system

10. VBA reference to Cd-ROM drive

11. Finding CD-ROM Drive Letter

12. CD-ROM drive letter?

 

 
Powered by phpBB® Forum Software