Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Vbscript : I need to kill a process at a certain path using vbs.  (Java.exe that is located in a certain folder)

Posted on 2007-11-27
8
Medium Priority
?
4,051 Views
Last Modified: 2008-06-10
please help
0
Comment
Question by:itbabe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20356555
if you are using win xp then use shell function and fire "tskill java.exe"
0
 

Author Comment

by:itbabe
ID: 20356563
I have 2 java.exe's running and only want to kill the one at a particular path.
0
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20356584
you cant kill at particular path, but you can either kill all process by name or either by process id (PID) using same tskill command. For more help on that go to command prompt and type tskill and enter key for help.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 31

Expert Comment

by:merowinger
ID: 20356674
as asvforce said, u cant kill a process on a specified path, but the following code shows how to kill a task:



Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
strComputer = "."
strProcessKill = "'calc.exe'"

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
   objProcess.Terminate()
Next
0
 

Accepted Solution

by:
itbabe earned 0 total points
ID: 20444042
If you replace "Where Name" by "Where Executablepath" it works according to my requirements.
0
 
LVL 31

Expert Comment

by:merowinger
ID: 20448714
nice idea :)
0
 
LVL 1

Expert Comment

by:modus_operandi
ID: 20479114
Closed, 500 points refunded.
modus_operandi
EE Moderator
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

609 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