• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

how can I check to see if a process is running from a vb .net service

Hi There,

I was wondering how I can check to see if a process is running in windows and if it is then kill it?

Sean - thanks in advance

0
bullrout
Asked:
bullrout
  • 3
1 Solution
 
armoghanCommented:
Hi bullrout,
Dim p As Process() = System.Diagnostics.Process.GetProcessesByName("iexplore")
To get all instances of IE
or just
Dim p As Process() = System.Diagnostics.Process.GetProcesses()
for all processes

Cheers!
0
 
armoghanCommented:
bullrout,
Afterwords you can do
p(0).Kill
0
 
armoghanCommented:
bullrout,
Or if you want to shut it down gracefully and it is a Window based application, you can do
p(0).CloseMainWindow
0
 
bullroutAuthor Commented:
Hi There,

I forgot about this one sorry :)

Sean
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now