Terminating explorer.exe
-
Hello all, I really must be missing something here, as all my attempts to terminate explorer.exe all end up with it restarting. I am calling TerminateProcess on explorer.exe, and the call IS working. However, explorer.exe just ends up starting up again. But when I terminate explorer.exe from taskmgr, it doesn't restart. Why is this happening? And how can I prevent the restarting? Thanks in advance. :)
-
Hello all, I really must be missing something here, as all my attempts to terminate explorer.exe all end up with it restarting. I am calling TerminateProcess on explorer.exe, and the call IS working. However, explorer.exe just ends up starting up again. But when I terminate explorer.exe from taskmgr, it doesn't restart. Why is this happening? And how can I prevent the restarting? Thanks in advance. :)
Um...Just for the record, terminating explorer.exe is generally not a good thing. And keeping it from restarting is even worse! explorer.exe is basically the user-interface part of Windows. If it is terminated, it will keep the end user from using the taskbar and desktop icons while ticking him/her off. And if it doesn't restart, the end-user will have to manually start it again. That being said, I will now try and answer your question. Windows is programmed to restart explorer.exe when it is terminated by any means other than shutting down. If anyone knows how to keep it from restarting, I highly doubt that they will tell you. Leave explorer.exe to Microsoft.
Come on! Get down with the sickness! - Disturbed
-
Um...Just for the record, terminating explorer.exe is generally not a good thing. And keeping it from restarting is even worse! explorer.exe is basically the user-interface part of Windows. If it is terminated, it will keep the end user from using the taskbar and desktop icons while ticking him/her off. And if it doesn't restart, the end-user will have to manually start it again. That being said, I will now try and answer your question. Windows is programmed to restart explorer.exe when it is terminated by any means other than shutting down. If anyone knows how to keep it from restarting, I highly doubt that they will tell you. Leave explorer.exe to Microsoft.
Come on! Get down with the sickness! - Disturbed
I know very well what I am doing by terminating explorer.exe, and I can assure you I have a good enough reason to be doing it. ;P
Kenny McKee wrote:
Windows is programmed to restart explorer.exe when it is terminated by any means other than shutting down.
How exactly does taskmgr manage to kill explorer?
-
I know very well what I am doing by terminating explorer.exe, and I can assure you I have a good enough reason to be doing it. ;P
Kenny McKee wrote:
Windows is programmed to restart explorer.exe when it is terminated by any means other than shutting down.
How exactly does taskmgr manage to kill explorer?
It appears as though the required functions to do this are part of the OS, and can't be used based on this forum[^]. That is what I gather anyway. I didn't mean to make it appear as though I was insulting your intelligence. I just wanted to be sure that you knew the dangers. :-O
How many bytes of text have I typed in my lifetime??? Man, I wish I kept track...
-
Hello all, I really must be missing something here, as all my attempts to terminate explorer.exe all end up with it restarting. I am calling TerminateProcess on explorer.exe, and the call IS working. However, explorer.exe just ends up starting up again. But when I terminate explorer.exe from taskmgr, it doesn't restart. Why is this happening? And how can I prevent the restarting? Thanks in advance. :)
First TerminateProcess is not good way for close a program why? MSDN: All object handles opened by the process are closed. All threads in the process terminate their execution. The state of the process object becomes signaled, satisfying threads waiting for the process to terminate. The states of all threads of the process become signaled, satisfying threads waiting for the threads to terminate. The termination status of the process changes from STILL_ACTIVE to the exit value of the process. Terminating a process does not necessarily remove the process object from the system. A process object is deleted when the last handle to the process is closed.
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
First TerminateProcess is not good way for close a program why? MSDN: All object handles opened by the process are closed. All threads in the process terminate their execution. The state of the process object becomes signaled, satisfying threads waiting for the process to terminate. The states of all threads of the process become signaled, satisfying threads waiting for the threads to terminate. The termination status of the process changes from STILL_ACTIVE to the exit value of the process. Terminating a process does not necessarily remove the process object from the system. A process object is deleted when the last handle to the process is closed.
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
Thanks for your reply Hamid. I can assure you that TerminateProcess will be my last resort in attempting to kill explorer ;P The thing is, I don't want to send a WM_CLOSE message to explorer.exe, as that brings up the Windows shutdown prompt. Is there any other way I can exit explorer.exe, excluding "tskill explorer"?
-
It appears as though the required functions to do this are part of the OS, and can't be used based on this forum[^]. That is what I gather anyway. I didn't mean to make it appear as though I was insulting your intelligence. I just wanted to be sure that you knew the dangers. :-O
How many bytes of text have I typed in my lifetime??? Man, I wish I kept track...
Oh it's alright. I expected some suspicion anyways :laugh: I read an article a few minutes ago on cleanly shutting down explorer.
http://jeffcode.blogspot.com/2007/12/how-to-cleanly-start-and-stop.html[^]
The way to tell Explorer to shut down is to say you want to shutdown the machine, but then cancel in a special way: Start->Shutdown->CTRL+ALT+SHIFT+Cancel
If I were to monitor explorer.exe, would I be able to see the function calls that do this? EDIT: I don't think I can. explorer just ends itself like any other app. New question: Would it be possible to inject something into explorer and call ExitProcess(0) within the process? Thanks a lot for your help :)
modified on Monday, March 16, 2009 2:56 PM
-
Oh it's alright. I expected some suspicion anyways :laugh: I read an article a few minutes ago on cleanly shutting down explorer.
http://jeffcode.blogspot.com/2007/12/how-to-cleanly-start-and-stop.html[^]
The way to tell Explorer to shut down is to say you want to shutdown the machine, but then cancel in a special way: Start->Shutdown->CTRL+ALT+SHIFT+Cancel
If I were to monitor explorer.exe, would I be able to see the function calls that do this? EDIT: I don't think I can. explorer just ends itself like any other app. New question: Would it be possible to inject something into explorer and call ExitProcess(0) within the process? Thanks a lot for your help :)
modified on Monday, March 16, 2009 2:56 PM
The forum that I gave you the link to seems to say something about replacing explorer.exe, but I haven't went very in depth with that and it sounds like it might cause quite a few problems.
How many bytes of text have I typed in my lifetime??? Man, I wish I kept track...