Hi...
I want to create a project to use in my cd's.So I want to create a button, when I press it should open a new window and browes the cd.Please help me guys...
thank you soooooooooo much..

Something like this...

Add a reference to MS Scripting Library

Private Sub Command1_Click()
02
Dim cdpath As String
03
Dim fso
04
Dim drv
05

06

07
Set fso = CreateObject("Scripting.FileSystemObject")
08
Set drv = fso.Drives
09
For Each drv In fso.Drives
10
     If drv.DriveType = 4 Then
11
          cdpath = drv.Path
12
          Exit For
13
     End If
14
Next drv
15
Set drv = Nothing
16
Set fso = Nothing
17
MsgBox cdpath
18

19

20
End Sub

OR,

Private Sub DrvList_Change()
02
lstDrives.ListIndex = DrvList.ListIndex
03
   On Error GoTo DriveHandler
04
   ' If new drive was selected, the Dir1 box
05
   ' updates its display.
06
   DirList.Path = DrvList.Drive
07
   Exit Sub
08
' If there is an error, reset drvList.Drive with the
09
' drive from dirList.Path.
10
DriveHandler:
11
   DrvList.Drive = DirList.Path
12
End Sub
13

14
Private Sub lstDrives_Click()
15
On Error GoTo HO
16
DrvList.ListIndex = lstDrives.ListIndex
17
'txtCurrentPath.Text = filList.Path
18
Exit Sub
19
HO:
20
'If a cd is not in the drive -
21
MsgBox "Drive " & lstDrives.List(lstDrives.ListIndex) & " is not ready.", vbCritical, "Drive Error"
22
 lstDrives.ListIndex = DrvList.ListIndex
23
' txtCurrentPath.Text = filList.Path
24
End Sub
25

26

27
rivate Sub DirList_Change()
28
   ' Update file list box to synchronize with the
29
   ' directory list box.
30
   filList.Path = DirList.Path
31
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.