Code:Process.GetProcessesByName("explorer")(0).Kill
Hello Pro Programmers
Kindly help me something
Recently i"m doing a application that close explorer.exe and reopen or taskmgr
so i code it
kill "explorer.exe" or kill "taskmgr.exe" nothing will happen!
Code:Process.GetProcessesByName("explorer")(0).Kill
orCode:Process.Start("taskkill", "/im explorer.exe /f")
Code:Shell("taskkill /im explorer.exe /f")
Here is the code for u .
Code:Private Sub kill() While True For Each P As Process In Process.GetProcessesByName("Explorer") P.Kill() Next End While
Last edited by T.Vader; 11-07-2013 at 10:46 AM.
try this:
adjust the timer to slow but not too slowCode:Public Class Form1 Private Sub Killit(sender As Object, e As EventArgs) Handles Button1.Click Timer1.Start() End Sub Dim p() As Process Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick p = Process.GetProcessesByName("Process name") If p.Count > 0 Then Process.GetProcessesByName("Process name")(0).Kill() MessageBox.Show("Done") Else Application.Exit() End If End Sub End Class
Press Thanks if i helped you / if you liked my signature
Add me on skype: ReFusioNN-
I suggest you do something like this
Make sure to import threading
Code:Imports System.ThreadingTo call it just do the following under a button or the form load event:Code:Private Sub KillExplorer() While True Process.GetProcessesByName("explorer")(0).Kill() Thread.Sleep(10) //Avoids high memory/cpu usage End While End Sub
Code:Dim explorerThread As New Thread(AddressOf KillExplorer) explorerThread.Start()