|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Kill explorer process and disable it restart automaticallyHello,
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 ////////////////////////////////////////////
Show quote
Hide quote
On Nov 27, 4:28 pm, "yxq" <ga***@163.net> wrote: Hi,> 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 > //////////////////////////////////////////// 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. 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. Show quoteHide quote "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 > //////////////////////////////////////////// > > > > 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 /////////////////////////////////////////////// Show quoteHide quote "Joel Merk" <JoelM***@discussions.microsoft.com> дÈëÏûÏ¢ÐÂÎÅ:2C7BD3B9-794E-43B7-8459-935E4DE42***@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 >> //////////////////////////////////////////// >> >> >> >> > 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 Show quoteHide quote "Joel Merk" <JoelM***@discussions.microsoft.com> дÈëÏûÏ¢ÐÂÎÅ:2C7BD3B9-794E-43B7-8459-935E4DE42***@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 >> //////////////////////////////////////////// >> >> >> >> >
Call HTML control in code behind (ASP.net 2.0)
Visual Studio 2005: VB fill circle automatic Can I write this program? OT - Vista Search and Recursive GetFiles Fastest way to import large fixed width file into a DataTable Setting up Policies to run Exe file from network drive Problem Using VB.net Class Library DLL in VBScript [VB2008] How to replace lines in a textfile? DLL NOT FOUND (but only on certain systems???) Is setting Bounds Property the same as setting Size and Location? |
|||||||||||||||||||||||