How to kill a particular process forcibly

Reply

Join Date: Jul 2008
Posts: 12
Reputation: karthiknv is an unknown quantity at this point 
Solved Threads: 0
karthiknv karthiknv is offline Offline
Newbie Poster

How to kill a particular process forcibly

 
0
  #1
Jan 27th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 1,102
Reputation: cguan_77 has a little shameless behaviour in the past 
Solved Threads: 91
cguan_77's Avatar
cguan_77 cguan_77 is offline Offline
Veteran Poster

Re: How to kill a particular process forcibly

 
0
  #2
Jan 27th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 12
Reputation: karthiknv is an unknown quantity at this point 
Solved Threads: 0
karthiknv karthiknv is offline Offline
Newbie Poster

Re: How to kill a particular process forcibly

 
0
  #3
Jan 28th, 2009
can somebody give me code to kill the process using system.diagnostics.process
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: How to kill a particular process forcibly

 
0
  #4
Jan 28th, 2009
Originally Posted by cguan_77 View Post
...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 ?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 12
Reputation: karthiknv is an unknown quantity at this point 
Solved Threads: 0
karthiknv karthiknv is offline Offline
Newbie Poster

Re: How to kill a particular process forcibly

 
0
  #5
Jan 28th, 2009
I should not kill the other copies.....i have to kill a particular process of a window only.... i need the code in VB6....
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 1,102
Reputation: cguan_77 has a little shameless behaviour in the past 
Solved Threads: 91
cguan_77's Avatar
cguan_77 cguan_77 is offline Offline
Veteran Poster

Re: How to kill a particular process forcibly

 
0
  #6
Jan 28th, 2009
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 12
Reputation: karthiknv is an unknown quantity at this point 
Solved Threads: 0
karthiknv karthiknv is offline Offline
Newbie Poster

Re: How to kill a particular process forcibly

 
0
  #7
Jan 29th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: How to kill a particular process forcibly

 
0
  #8
Jan 29th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 483
Reputation: DangerDev has a spectacular aura about DangerDev has a spectacular aura about 
Solved Threads: 58
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Pro in Training

Re: How to kill a particular process forcibly

 
0
  #9
Jan 29th, 2009
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().
Freedom in the Mind, Faith in the words.. Pride in our Souls...
Indian Developer
http://falaque.wordpress.com/
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: How to kill a particular process forcibly

 
0
  #10
Jan 29th, 2009
Originally Posted by DangerDev View Post
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...
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC