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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbscript to launch a vbapp

Status
Not open for further replies.

MartDawg

Programmer
Jan 14, 2004
33
US
Hi, currently I have a batch file to launch a vb application, the app takes a couple parameters, so my batch file looks like the following...

@ECHO OFF

C:
CD\a directory
someapp.exe param1 "param 2"

My problem is, when the app finishes executing, a message box is displayed.

In vbscript isn't there a way to start an application with the getobject command? If so, can I pass it arguments?

My final question. Is there a way to depress the button on the vbapp with a seperate vbscript? Or is there a way to kill the app efficiently without leaving a memory leak?

Hope this makes sense. Thanks to anybody who replies.
 
GetObject - I didnt know this one myself, but apparently its for "Automation" objects, which would be OLE and/or COM I think. It would apply to your VB app only IF it has been developed to support it.

For launching any old app:

set WShell = CreateObject("WScript.Shell")
WShell.Run "c:\____\myapp.exe arg1 arg2", 1, True

where arg1,arg2 are command-line arguments if required. You may need embedded quotes "myapp.exe ""arg with space 1""".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top