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
3,923 Views
Last Modified: 2008-06-10
please help
0
Comment
Question by:itbabe
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 23

Expert Comment

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

Author Comment

by:itbabe
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 31

Expert Comment

by:merowinger
Comment Utility
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
Comment Utility
If you replace "Where Name" by "Where Executablepath" it works according to my requirements.
0
 
LVL 31

Expert Comment

by:merowinger
Comment Utility
nice idea :)
0
 
LVL 1

Expert Comment

by:modus_operandi
Comment Utility
Closed, 500 points refunded.
modus_operandi
EE Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

13 Experts available now in Live!

Get 1:1 Help Now