|
-
March 13th, 2001, 12:06 PM
#1
Set Shell Path at Runtim
I have a VB6 application that is the startup.exe on a CD-Rom.
Using the Shell command, this exe will launch one of two things on a
command click - either another .exe to install a plug-in, or an HTML within
the default browser.
My code is as follows:
Private Sub Command2_Click()
Dim wd$
Dim pa$
Dim fe$
wd = "D:\" ' set the working directory
fe = "D:\default.htm" 'set the file to execute
pa = "" ' Set the command line parameters
ShellExecute hwnd, "open", fe, pa, wd, 1
Question: Rather than manually defining the path, ie. "D:\", is there some
way to determine where the user's CD-Rom is, and assign that to the path at
runtime? Otherwise, the above code only works IF the user has d:\ as their
CD-Rom!
Thanks for any assistance!
jamie
-
March 13th, 2001, 12:29 PM
#2
Re: Set Shell Path at Runtim
The path from which a program is run is held in:
App.Path
You could use this, as your exe is being run from the CD Rom.
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
-
March 13th, 2001, 12:42 PM
#3
Re: Set Shell Path at Runtim
Thank you! Worked like a charm! Such a simple solution, and yet it took me all morning to find it. 
jamie
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
|