Link to home
Start Free TrialLog in
Avatar of svenkatapuram
svenkatapuram

asked on

Running Two Executables (one after another)

I have two Executables (VB 6.0). First i want to start the application with one Exe. And based on the variable value i am collecting from the first EXE i want to end the first one and start the second EXEecutable or i may not start the second one at all. This should be seemless to the user. I do not know which is the best way to do.
Avatar of nzjonboy
nzjonboy

you could write the value to an ini file and then call the next executable, the next executable could then read the value and could also get the handle of the first and close it or the first could close itself. another way would be to parse the value in the command line for the second executable and read it from there.

nzjonboy
Avatar of svenkatapuram

ASKER

I do not want to do the first way. Can you be more specific about the second method. (Reading from the command line)
Sven,
You can pass a command line variable to the second exe by shelling the second exe with a command line parameter.  (syn: Shell(App.Path & "\My2ndExe.exe /Option1",vbNormal))
then in your Second app look for the command line parameter and code according to the result.  (syn : Dim MyValue as String

MyValue = Ucase(Command)
)
This will the allow you to write a select case based on the different options that are able to be passed.  Hope this helps
possbily I misunderstand your question but here's what I think you're asking:

How do I have one application decide whether or not to kick off a second application (and I don't have to pass any information from one to the other).

If that's what you're trying to do, then just

if decision = YES then

end if
possbily I misunderstand your question but here's what I think you're asking:

How do I have one application decide whether or not to kick off a second application (and I don't have to pass any information from one to the other).

If that's what you're trying to do, then just

if decision = YES then

end if
sorry, I hit the wrong key.

I mean:

if decision = YES then
shell "<second app path & name>"
end if
ASKER CERTIFIED SOLUTION
Avatar of n_narayanan
n_narayanan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, please read shell(app.path,"\2ndexe.exe", vbnormal) in the above comment as

Call Shell(App.Path & "\2ndExe.exe ", vbNormal)

Narayanan
Ohhh, again made a mistake

it should be

Call Shell(strexe, vbNormal)
Any specific reason for grade "B"?

Narayanan