?
Solved

Running Two Executables (one after another)

Posted on 2002-05-02
10
Medium Priority
?
146 Views
Last Modified: 2010-05-02
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.
0
Comment
Question by:svenkatapuram
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 3

Expert Comment

by:nzjonboy
ID: 6987204
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
0
 

Author Comment

by:svenkatapuram
ID: 6987244
I do not want to do the first way. Can you be more specific about the second method. (Reading from the command line)
0
 
LVL 4

Expert Comment

by:Glowman
ID: 6987296
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
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Expert Comment

by:HobbitHouse
ID: 6987395
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
0
 

Expert Comment

by:HobbitHouse
ID: 6987396
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
0
 

Expert Comment

by:HobbitHouse
ID: 6987400
sorry, I hit the wrong key.

I mean:

if decision = YES then
shell "<second app path & name>"
end if
0
 
LVL 3

Accepted Solution

by:
n_narayanan earned 150 total points
ID: 6987796
1st EXE

Lets say you wanted to take a decision

If pwd = "something" then
  dim strexe as string
  strexe = "2nd.EXE" & " " & " ABC"
  Shell(App.Path & "\2ndExe.exe ",vbNormal)
  end
else
  end
end if

===========
In 2nd EXE
Form_Load Event,

dim passedvalue as string
passedvalue = command

If Len(Trim((Command$))) = 0 Then
   'Not a valid arguement
   'Hence it is called by user not by the 1st exe
   end
end if

if Command$ <> "ABC" then
   'Arguement is wrong.
   end
end if
   
This way you can authendicate the 2nd exe from 1st exe.

Cheers

Narayanan




0
 
LVL 3

Expert Comment

by:n_narayanan
ID: 6987798
Sorry, please read shell(app.path,"\2ndexe.exe", vbnormal) in the above comment as

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

Narayanan
0
 
LVL 3

Expert Comment

by:n_narayanan
ID: 6987803
Ohhh, again made a mistake

it should be

Call Shell(strexe, vbNormal)
0
 
LVL 3

Expert Comment

by:n_narayanan
ID: 6994016
Any specific reason for grade "B"?

Narayanan
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question