Stop and Application from the code knowing the Name

The Following Lines Loops on all running processes and find my application by name and stop it

Dim p As System.Diagnostics.Process
For Each p In System.Diagnostics.Process.GetProcesses(path)
If p.ProcessName.StartsWith(“my application name”) Then
p.Kill()
End If
Next

Advertisements

Posted on January 4, 2010, in How To, VB.NET. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: