how to make a "browse cd" button

browse cd button code and how to make it in visual basic 6

Page 1 of 1

7 Replies - 3311 Views - Last Post: 06 June 2009 - 01:25 AM Rate Topic: -----

#1 wessamnz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-June 09

how to make a "browse cd" button

Post icon  Posted 04 June 2009 - 07:44 AM

hello everybody
pls i need help about this topic
here is my problem

i made a form with a button (that will be for cd intro) i put a caaption for this button called " browse cd "
and i put another button with caption " setup "
the quz is wts the codes to make that and how coz im still bignner

its excatly look like wen we open a device driver cd
an autorun splash screen apeared have buttons like "setup", "install", "browse this cd"
i want to make like that
i hope u got my problem
plz help me
and forgive me for my broke engish
thank u

Is This A Good Question/Topic? 0
  • +

Replies To: how to make a "browse cd" button

#2 sloanthrasher  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 18
  • Joined: 31-May 09

Re: how to make a "browse cd" button

Posted 04 June 2009 - 05:35 PM

View Postwessamnz, on 4 Jun, 2009 - 06:44 AM, said:

hello everybody
pls i need help about this topic
here is my problem

i made a form with a button (that will be for cd intro) i put a caaption for this button called " browse cd "
and i put another button with caption " setup "
the quz is wts the codes to make that and how coz im still bignner

its excatly look like wen we open a device driver cd
an autorun splash screen apeared have buttons like "setup", "install", "browse this cd"
i want to make like that
i hope u got my problem
plz help me
and forgive me for my broke engish
thank u


If I understand what you're asking, you want to have an application that when the user clicks on "Browse The CD", it will display the contents of the CD. There are several ways to display the contents.
  • You could open Windows Explorer and have it pointed to the CD Drive, and maybe a subdirectory.
  • You might have your own "table of contents", i.e. a set of buttons for each item on the CD on another form.
If you want to open Windows Explorer, there are several things to do. First, you need to find out what is the drive letter for the CD.
Lookup App.Path for that.
To launch Windows Explorer, you can use the shell command. Here's an example:
Shell "c:\windows\explorer.exe c:\", vbNormalFocus


Another issue to contend with is that for a VB application to run, the runtime files have to be installed on the target machine. That might take some head scratching. I'd Google VB6 stand alone or something similar.
Anyway, I hope that gets you going in the right direction.
Was This Post Helpful? 0
  • +
  • -

#3 wessamnz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-June 09

Re: how to make a "browse cd" button

Posted 04 June 2009 - 09:30 PM

thank u sloan but thos code for a spacific drive
but wt i mean is
for example
if my cd drive is "D:\"
and another one have the cd drive is '"G:\"
and there is peoples have 2 drives of cd
so i want just open and explorer my cd which be in "x:\"
and this x might be d: or e: or f: etc....
it must be the spacfic cd i made the intro.
i killed the internet searching for that
hahahha and im about to kill my self also

u see this
Posted Image
i want somthing like this

i found a code for locate th cd drive
here it is

Private Sub Command1_Click()
Dim cdpath As String
Dim fso
Dim drv


Set fso = CreateObject("Scripting.FileSystemObject")
Set drv = fso.Drives
For Each drv In fso.Drives
	 If drv.DriveType = 4 Then
		  cdpath = drv.Path
		  Exit For
	 End If
Next drv
Set drv = Nothing
Set fso = Nothing
MsgBox cdpath


End Sub


plus this code as u typed

dim x

x = Shell("c:\windows\explorer.exe c:\", vbNormalFocus)


so i want to make a relation between the cdpath in the first code and put it insted of c: in the second code

thank u again and pls help me

This post has been edited by wessamnz: 04 June 2009 - 10:13 PM

Was This Post Helpful? 0
  • +
  • -

#4 wessamnz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-June 09

Re: how to make a "browse cd" button

Posted 04 June 2009 - 09:59 PM

i tried to make that but i faild
look wt i did

here is th form
Posted Image

and here is the code
Private Sub Command1_Click()
Dim cdpath As String
Dim fso
Dim drv



Set fso = CreateObject("Scripting.FileSystemObject")
Set drv = fso.Drives
For Each drv In fso.Drives
	 If drv.DriveType = 4 Then
		  cdpath = drv.Path
		  Exit For
	 End If
Next drv
Set drv = Nothing
Set fso = Nothing

Text1 = cdpath

End Sub


this wt happend wen run
Posted Image

its working up to here
ok!
i try to add this code but it doesn't work
Private Sub text1_Change()
Dim x
Dim z As String

 z = Text1.Text
x = Shell("c:\windows\explorer.exe z\", vbNormalFocus)
End Sub

but it just open windows explorer not the cd

notice z!!!

thats my setuation right now
im about to die
help me

This post has been edited by wessamnz: 04 June 2009 - 10:14 PM

Was This Post Helpful? 0
  • +
  • -

#5 Jupiter 2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 05-June 09

Re: how to make a "browse cd" button

Posted 05 June 2009 - 07:41 AM

You need a DrivesListbox, A ListDrives List and a Direcetory List box

Private Sub DrvList_Change()
lstDrives.ListIndex = DrvList.ListIndex
   On Error GoTo DriveHandler
   ' If new drive was selected, the Dir1 box
   ' updates its display.
   DirList.Path = DrvList.Drive
   Exit Sub
' If there is an error, reset drvList.Drive with the
' drive from dirList.Path.
DriveHandler:
   DrvList.Drive = DirList.Path
End Sub

Private Sub lstDrives_Click()
On Error GoTo HO
DrvList.ListIndex = lstDrives.ListIndex
'txtCurrentPath.Text = filList.Path
Exit Sub
HO:
'If a cd is not in the drive - 
MsgBox "Drive " & lstDrives.List(lstDrives.ListIndex) & " is not ready.", vbCritical, "Drive Error"
 lstDrives.ListIndex = DrvList.ListIndex
' txtCurrentPath.Text = filList.Path
End Sub


rivate Sub DirList_Change()
   ' Update file list box to synchronize with the
   ' directory list box.
   filList.Path = DirList.Path
End Sub


It's not easy to just give you snippets.

===================================
"If all my answers are wrong, only then will I read the question."
Was This Post Helpful? 0
  • +
  • -

#6 wessamnz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-June 09

Re: how to make a "browse cd" button

Posted 05 June 2009 - 10:06 PM

hello jupiter
thank u for ur help
i did wt u said but nothing happend
offcourse coz im still a beginner i think i need more explain
so i ask u plz remmber u still deal with a donky in vb hahahahaha
could u separate the codes i mean explain more
im sorry for disturbing but im still soo beginner this is my first program

all i want is wen i press that button windows explorer run and show the contains of the cd thats all
forgive me again for my fool and my broken english
thank u
Was This Post Helpful? 0
  • +
  • -

#7 Jupiter 2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 05-June 09

Re: how to make a "browse cd" button

Posted 05 June 2009 - 10:53 PM

If you know nothing about what I've given you then you need to get a book and take some classes. I can't explain it all. It takes too long. I don't mind helping out when the other person has some knowledge but to do the whole project is not the same thing. I'd have to charge you a fee, more than what you earn in a month.
Was This Post Helpful? 0
  • +
  • -

#8 wessamnz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 04-June 09

Re: how to make a "browse cd" button

Posted 06 June 2009 - 01:25 AM

any way i have to say thank u for ur help jupiter
hahahaha
but im a poor man i cant pay u
ill wait for another help
thanks again
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1