By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,320 Members | 2,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,320 IT Pros & Developers. It's quick & easy.

Kill explorer process and disable it restart automatically

P: n/a
yxq
Hello,
I want to kill the Explorer process, after Explorer process has been killed,
it will restart automatically immediately. How to disable it restart
automatically? for example, in Windows Task Manager, you can kill explorer
process, but it will not restart automatically.

My code:

/////////////////////////////////////////////
For Each ObjPro As Process In Process.GetProcessesByName("EXPLORER")
ObjPro.Kill()
Do Until ObjPro.HasExited = True
Application.DoEvents()
Loop
Next
////////////////////////////////////////////

Nov 27 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Nov 27, 4:28 pm, "yxq" <ga...@163.netwrote:
Hello,
I want to kill the Explorer process, after Explorer process has been killed,
it will restart automatically immediately. How to disable it restart
automatically? for example, in Windows Task Manager, you can kill explorer
process, but it will not restart automatically.

My code:

/////////////////////////////////////////////
For Each ObjPro As Process In Process.GetProcessesByName("EXPLORER")
ObjPro.Kill()
Do Until ObjPro.HasExited = True
Application.DoEvents()
Loop
Next
////////////////////////////////////////////
Hi,
May I know why you want to kill Explorer process from your code,
since this is a System process ? May be there is workaround for your
problem.
Also please specify more details about your actual problem.
Thanks,
coolCoder

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
If you find this post helpful, please rate it.
Nov 27 '07 #2

P: n/a
I have found that using a loop (possibly within a separate thread, or perhaps
a timer, depending on how you want to do it) to constantly check if Explorer
has restarted, and then kill it again works well. After a while, it stops
automatically restarting. Not that I recommend doing it, but if you feel that
you need to, then that's how I suggest doing it.

"yxq" wrote:
Hello,
I want to kill the Explorer process, after Explorer process has been killed,
it will restart automatically immediately. How to disable it restart
automatically? for example, in Windows Task Manager, you can kill explorer
process, but it will not restart automatically.

My code:

/////////////////////////////////////////////
For Each ObjPro As Process In Process.GetProcessesByName("EXPLORER")
ObjPro.Kill()
Do Until ObjPro.HasExited = True
Application.DoEvents()
Loop
Next
////////////////////////////////////////////

Nov 28 '07 #3

P: n/a
yxq
I have done successfully.
///////////////////////////////////////////////////////////////
Public Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As
IntPtr, ByVal uExitCode As UInteger) As Integer

For Each ObjPro As Process In Process.GetProcessesByName("EXPLORER")
TerminateProcess(ObjPro.Handle, 1)
Do Until ObjPro.HasExited = True
Application.DoEvents()
Loop
Next
///////////////////////////////////////////////
"Joel Merk" <Jo******@discussions.microsoft.com写入消息新闻:2C **********************************@microsoft.com.. .
>I have found that using a loop (possibly within a separate thread, or
perhaps
a timer, depending on how you want to do it) to constantly check if
Explorer
has restarted, and then kill it again works well. After a while, it stops
automatically restarting. Not that I recommend doing it, but if you feel
that
you need to, then that's how I suggest doing it.

"yxq" wrote:
>Hello,
I want to kill the Explorer process, after Explorer process has been
killed,
it will restart automatically immediately. How to disable it restart
automatically? for example, in Windows Task Manager, you can kill
explorer
process, but it will not restart automatically.

My code:

/////////////////////////////////////////////
For Each ObjPro As Process In Process.GetProcessesByName("EXPLORER")
ObjPro.Kill()
Do Until ObjPro.HasExited = True
Application.DoEvents()
Loop
Next
////////////////////////////////////////////


Nov 28 '07 #4

P: n/a
yxq
Public Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As
IntPtr, ByVal uExitCode As UInteger) As Integer

For Each ObjPro As Process In Process.GetProcessesByName("EXPLORER")
Do Until TerminateProcess(ObjPro.Handle, 1)
Application.DoEvents()
Loop
Next

"Joel Merk" <Jo******@discussions.microsoft.com写入消息新闻:2C **********************************@microsoft.com.. .
>I have found that using a loop (possibly within a separate thread, or
perhaps
a timer, depending on how you want to do it) to constantly check if
Explorer
has restarted, and then kill it again works well. After a while, it stops
automatically restarting. Not that I recommend doing it, but if you feel
that
you need to, then that's how I suggest doing it.

"yxq" wrote:
>Hello,
I want to kill the Explorer process, after Explorer process has been
killed,
it will restart automatically immediately. How to disable it restart
automatically? for example, in Windows Task Manager, you can kill
explorer
process, but it will not restart automatically.

My code:

/////////////////////////////////////////////
For Each ObjPro As Process In Process.GetProcessesByName("EXPLORER")
ObjPro.Kill()
Do Until ObjPro.HasExited = True
Application.DoEvents()
Loop
Next
////////////////////////////////////////////


Nov 28 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.