Solved

Running Two Executables (one after another)

Posted on 2002-05-02
10
143 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
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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 50 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Saving history changes to sub form 4 48
vb6 connector to mongodb 2 117
How to compare ms sql hashbytes results within vb6 5 84
VBA: loop recent folder and copy txt file. 8 33
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 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