How ro kill a program/process if it is running from within VB6

A

Athena

Hello,

I run a program from within a VB program using shell. After the first
instance of the program, before I call it again, I need to kill it. How can
I do it so that only one instance of the program runs? Thank you.

Athena

Like this:

If DebugFlag = False Then
Kill "AProgram" ' if it is running if not
Shell "AProgram test", vbNormalFocus
End If
 
J

John W. Vinson

Hello,

I run a program from within a VB program using shell. After the first
instance of the program, before I call it again, I need to kill it. How can
I do it so that only one instance of the program runs? Thank you.

Athena

Like this:

If DebugFlag = False Then
Kill "AProgram" ' if it is running if not
Shell "AProgram test", vbNormalFocus
End If

You might want to ask this question in a VB newsgroup; this newsgroup is for
the Microsoft Access database product.

John W. Vinson [MVP]
 
T

Tony Toews [MVP]

Athena said:
I run a program from within a VB program using shell. After the first
instance of the program, before I call it again, I need to kill it. How can
I do it so that only one instance of the program runs? Thank you.

Athena

Like this:

If DebugFlag = False Then
Kill "AProgram" ' if it is running if not
Shell "AProgram test", vbNormalFocus
End If

What program is it? If it supports Automation such as Word or Excel then you can use
methods such as Application.Quit to close it down.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top