954,559 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to kill a particular process forcibly

Hi,

For my project, i have to kill a Java.exe process of a particular application forcibly( i have other application runs on java.exe- i should not kill it). Can somebody do the needful....it's very urgent...please help me....


Thanks & Regards,
Karthik

karthiknv
Newbie Poster
12 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

hi,be more specific you want to kill the process through a vb program..
or you just want to kill process in any way..you can use task manager to end a program..
or you can go command prompt use tasklist and tskill to end a program..
or if you want to do it in vb check out System.Diagnostics.Process

cguan_77
Nearly a Posting Virtuoso
1,317 posts since Apr 2007
Reputation Points: 19
Solved Threads: 115
 

can somebody give me code to kill the process using system.diagnostics.process

karthiknv
Newbie Poster
12 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 
...if you want to do it in vb check out System.Diagnostics.Process

Sure, If you are using .NET.... not gonna work in vb 4/5/6. I can get you the code to kill a process from within VB6, but figuring out how to know if it's the one you want to kill or not is a different story altogether. I suppose you could kill all copies of java, and then just open the one you want ?

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

I should not kill the other copies.....i have to kill a particular process of a window only.... i need the code in VB6....

karthiknv
Newbie Poster
12 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 
cguan_77
Nearly a Posting Virtuoso
1,317 posts since Apr 2007
Reputation Points: 19
Solved Threads: 115
 

In the above link, i didn't see killing a particular process(when some more same processes are running). Can somebody give me code using System.Diagnostics.Process. I think we can a kill process by checking for which application a particular process is running.

karthiknv
Newbie Poster
12 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

I'll say it again......

you're in the VB 4/5/6 forum. System.Diagnostics.Process is for VB.NET, NOT VB 4/5/6. If you want answers about it, then ask there. Not Here.

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

use
System.Diagnostics.Process.GetProcessesByName(processName);
to get all the process with this name. After this use the process properties like, process.ModuleName etc. to get the required process, then kill the process by calling function process.kill().

DangerDev
Posting Pro in Training
485 posts since Jan 2008
Reputation Points: 165
Solved Threads: 59
 
use System.Diagnostics.Process.GetProcessesByName(processName); to get all the process with this name. After this use the process properties like, process.ModuleName etc. to get the required process, then kill the process by calling function process.kill().


This section just for vb4/5/6. Don't make it become VB.Net Section...

Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 
Sure, If you are using .NET.... not gonna work in vb 4/5/6. I can get you the code to kill a process from within VB6, but figuring out how to know if it's the one you want to kill or not is a different story altogether. I suppose you could kill all copies of java, and then just open the one you want ?

i could really use this code you were talking about. thanks

crackerjacker
Junior Poster in Training
53 posts since Sep 2008
Reputation Points: 8
Solved Threads: 3
 

I saw somewhere in the internet,killing a process and process listing using Wrapper, in VB6. That's why i was asking the question....can we do that using NetFrameworkWrapper??

karthiknv
Newbie Poster
12 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 
SCBWV
Junior Poster
125 posts since Apr 2007
Reputation Points: 40
Solved Threads: 24
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You