how to execute an exe file from Visual Basic 6.0

Status
Not open for further replies.

redhat

Mad and Furious
Hi friends,
I am making a progam in VB. I need to execute an exe application that I made in VB. I need to execute it since, adding the source for 10 apps into one, is very difficult and will hog system memory. So, I want to know how to execute an exe file from an app made in VB 6.0. I am not very familiar with API's, but if you tell me the process, I will easily understand it.
Thank You in advance
 

nileshgr

Wise Old Owl
redhat said:
Hi friends,
I am making a progam in VB. I need to execute an exe application that I made in VB. I need to execute it since, adding the source for 10 apps into one, is very difficult and will hog system memory. So, I want to know how to execute an exe file from an app made in VB 6.0. I am not very familiar with API's, but if you tell me the process, I will easily understand it.
Thank You in advance
Wait for some VB ppl. And ur name is redhat but ur logo is not redhat! :) :p
 
OP
redhat

redhat

Mad and Furious
I want to execute a particular exe file when the user selects an option from the menu. These are just add-ons and are not related to the program itself.
 

Kiran.dks

Technomancer
redhat said:
Hi friends,
I am making a progam in VB. I need to execute an exe application that I made in VB. I need to execute it since, adding the source for 10 apps into one, is very difficult and will hog system memory. So, I want to know how to execute an exe file from an app made in VB 6.0. I am not very familiar with API's, but if you tell me the process, I will easily understand it.
Thank You in advance

Simple. Execute the exe file directly from Command line. Use shell or ShellExecute. See that you give the exact location of the exe.
 
Last edited:
OP
redhat

redhat

Mad and Furious
Hope this helps: *www.dreamincode.net/code/snippet276.htm

Arun

Thanks a lot,
It worked well for me
__________
Hi!
I am having a problem in using the "%Systemroot%" to refer to the "C"\Windows" directory.
I used to following code as suggested by sakumar79:
Code:
Dim RetVal
RetVal = Shell("%Systemroot%\System32\calc.exe", 1)
Please tell me where am I wring???
 
Last edited:

sakumar79

Technomancer
Try
Dim RetVal
RetVal = Shell(""%Systemroot%\System32\calc.exe"", 1)

Or
Dim winPath as string
Dim RetVal
winPath = Environ$("SystemRoot")
RetVal = Shell(winPath & "\System32\calc.exe"", 1)

Arun
 
Status
Not open for further replies.
Top Bottom