Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2005, 09:05 PM
Authorized User
 
Join Date: Jul 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default Terminating External Process

Hello Everyone and thanks for your help in advance. I have a third party program that is opened daily using Windows Scheduler, which in turn runs a process. However, at the end of the process, the program does not close itself instead simply terminating and leaving itself open. Because of this, Windows Scheduler fails on the next attempt to launch the program unless someone manually closes the program daily. I know a Windows form can launch an external exe, and assume it can also be used to close an external program or process, however, I do not know how to do this. Any insight on this topic would be greatly appreciated.

 
Old September 25th, 2005, 09:28 AM
Registered User
 
Join Date: Sep 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

This code is working.If you know the Process id.
So when process is starting. get the process id

Then use this
code

         Dim _id as Integer 'Process ID
         Dim _pr As New Process
        _pr = Process.GetProcessById(_id)
        _pr.Kill()


Difficult can be done immediately. But Impossible will take some more time.





Similar Threads
Thread Thread Starter Forum Replies Last Post
process.startinfo opens new instance of process Anypond General .NET 0 August 28th, 2008 05:35 AM
Problem terminating Excel seananderson Pro VB 6 2 May 9th, 2007 07:40 AM
Terminating an outside process. notrosh Visual C++ 0 October 11th, 2006 10:52 AM
external php?... jman11587 Beginning PHP 4 January 31st, 2004 12:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.