Stopping process

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi EveryBody:

How can I get the process by its name and stop it ?

Any help will be appreciate

regard's

Husam
 
Husam said:
How can I get the process by its name and stop it ?

\\\
Dim Processes() As Process = _
Process.GetProcessesByName("notepad")
For Each Process As Process In Processes
Process.CloseMainWindow()
Next Process
///
 
Hi,

Private Sub btnStartNotepad_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnStartNotepad.Click

Process.Start("Notepad")

End Sub

Private Sub btnCloseNotepad_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCloseNotepad.Click

For Each p As Process In Process.GetProcessesByName("Notepad")

p.Kill()

Next

End Sub



Ken

-------------------

Hi EveryBody:

How can I get the process by its name and stop it ?

Any help will be appreciate

regard's

Husam
 
This exact question was answered by me & Herfried 2 days ago & Herfried/Ken
answered this same question yesterday. So, 3 days in a row the same question
has been asked/answered now. If you would have searched a little you would
have found the solution

Crouchie1998
BA (HONS) MCP MCSE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top