Solved

terminate & start process in VB6

Posted on 2010-08-24
2
936 Views
Last Modified: 2012-05-10
How can I terminate a running windows process in VB6, the start it again?
 I have the process name and the .exe path
0
Comment
Question by:thenemesiz
2 Comments
 
LVL 20

Accepted Solution

by:
alainbryden earned 500 total points
ID: 33510661
0
 
LVL 11

Expert Comment

by:thydzik
ID: 33519985
see the attached code
Dim objshell
    Set objshell = CreateObject("Wscript.Shell")
	
    'kill a process
    objshell.Run "taskkill /IM programname.exe", 0, True
	
	'start a process
    objshell.Run "programname.exe", 0, True

Open in new window

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now