Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need some help with executing a program external of the one I wrote

Status
Not open for further replies.

Tonyn2002

Technical User
Dec 19, 2001
11
0
0
US
Hi,

I am new here, and am lost with this programming thing...

What I am trying to do is make a setup.exe that will point to either two different programs on the CD. But I have no idea how I would call to a program on the CD in which it is installed.

Basically on the CD I have two directory's with two seperate executables. Now if it is on a CD the drive letter changes from computer to computer...

So Q1,
What do I use in VB6 to execute the exe
Q2,
How do I tell the program where the file is located if it changes because it is a CD. Like on my computer it is D: on a friends it is E: - two different drives so I can't have the program call on D:\program.exe if on his computer it is E:\program.exe

Thanks in advance for any help
 
to execute your exe file, this is the most basic way, all it does it launches the app.
shell "application.exe"


The quick way to get the CD drive (if your calling application is also on the CD) is to use
app.path
It returns the path that your current .exe is in. If your base application is in the root folder of your CD then your done, just tack on the folder and appilcation name to that.
If not use
cdletter = left(app.path,1)
to get the CD letter.

hope that covers it.

 
OK i think i can kill both q's with 1 stone. basically, in VB6, u can do a "relative link" (if u like) to another exe. ie this would execute "setup.exe" in the same path as the exe:

Shell App.Path & "\setup.exe"

because "App.Path" returns the full path of the program (without the filename of the EXE), regardless of where it is, on a cd, hard drive, whatever!

anywayz, hope i've helped ;)

phr3-\-

for some of my muzic...
 
Thanks for the replies :)

That covers it, got it working now

Thanks again,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top