|
-
Sep 12th, 2000, 03:47 PM
#1
Take a look at this thread which shows how to determine the Drive letter and if there are any CDs in it.
-
Sep 12th, 2000, 04:14 PM
#2
Lively Member
If what you're trying to do - I didn't quite get your point - is trying to find the CD drive
and it's letter then use WMI:
Code:
Public Sub listDrives(Optional strServer As String = ".")
Dim objs As WbemScripting.SWbemObjectSet
Dim obj As WbemScripting.SWbemObject
Dim svcs As WbemScripting.SWbemServices
Dim swLocator As WbemScripting.SWbemLocator
Set swLocator = New WbemScripting.SWbemLocator
Set svcs = swLocator.ConnectServer(strServer)
Set objs = svcs.InstancesOf("Win32_LogicalDisk")
For Each obj In objs
If obj.Properties_.Item("DriveType") = 5 Then
Debug.Print "Name: " & obj.Properties_.Item("Name")
Debug.Print "Drive Type: " & obj.Properties_.Item("DriveType")
End If
Next obj
Set objs = Nothing
Set svcs = Nothing
Set swLocator = Nothing
End Sub
Of course you need WMI installed on your sys which is avail. free from microsoft.
C/C++,Delphi, VB6,Java,PB (blech!),ASP,JSP,SQL...bla bla bla and bla
I love deadlines. I like the whooshing sound they make as they fly by.
—Douglas Adams
-
Sep 13th, 2000, 09:06 AM
#3
Creating CDs
Thanks for the help I wrote the code yesterday from the VBA Developer's Handbook it din't give me the correct results so I modified it with your code. Is there some way to prevent directory browsing on a CD so that an expiration date on the material there will be effective?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|