Kill explorer process and disable it restart automatically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yxq

    #1

    Kill explorer process and disable it restart automatically

    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.GetProc essesByName("EX PLORER")
    ObjPro.Kill()
    Do Until ObjPro.HasExite d = True
    Application.DoE vents()
    Loop
    Next
    ////////////////////////////////////////////



  • coolCoder

    #2
    Re: Kill explorer process and disable it restart automatically

    On Nov 27, 4:28 pm, "yxq" <ga...@163.netw rote:
    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.GetProc essesByName("EX PLORER")
    ObjPro.Kill()
    Do Until ObjPro.HasExite d = True
    Application.DoE vents()
    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.

    Comment

    • =?Utf-8?B?Sm9lbCBNZXJr?=

      #3
      RE: Kill explorer process and disable it restart automatically

      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.GetProc essesByName("EX PLORER")
      ObjPro.Kill()
      Do Until ObjPro.HasExite d = True
      Application.DoE vents()
      Loop
      Next
      ////////////////////////////////////////////
      >
      >
      >
      >

      Comment

      • yxq

        #4
        Re: Kill explorer process and disable it restart automatically

        I have done successfully.
        ///////////////////////////////////////////////////////////////
        Public Declare Function TerminateProces s Lib "kernel32" (ByVal hProcess As
        IntPtr, ByVal uExitCode As UInteger) As Integer

        For Each ObjPro As Process In Process.GetProc essesByName("EX PLORER")
        TerminateProces s(ObjPro.Handle , 1)
        Do Until ObjPro.HasExite d = True
        Application.DoE vents()
        Loop
        Next
        ///////////////////////////////////////////////


        "Joel Merk" <JoelMerk@discu ssions.microsof t.comдÈëÏûϢРÎÅ:2C7BD3B9-794E-43B7-8459-935E4DE42C18@mi crosoft.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
        >automaticall y? 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.GetProc essesByName("EX PLORER")
        > ObjPro.Kill()
        > Do Until ObjPro.HasExite d = True
        > Application.DoE vents()
        > Loop
        > Next
        >////////////////////////////////////////////
        >>
        >>
        >>
        >>
        >

        Comment

        • yxq

          #5
          Re: Kill explorer process and disable it restart automatically

          Public Declare Function TerminateProces s Lib "kernel32" (ByVal hProcess As
          IntPtr, ByVal uExitCode As UInteger) As Integer

          For Each ObjPro As Process In Process.GetProc essesByName("EX PLORER")
          Do Until TerminateProces s(ObjPro.Handle , 1)
          Application.DoE vents()
          Loop
          Next

          "Joel Merk" <JoelMerk@discu ssions.microsof t.comдÈëÏûϢРÎÅ:2C7BD3B9-794E-43B7-8459-935E4DE42C18@mi crosoft.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
          >automaticall y? 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.GetProc essesByName("EX PLORER")
          > ObjPro.Kill()
          > Do Until ObjPro.HasExite d = True
          > Application.DoE vents()
          > Loop
          > Next
          >////////////////////////////////////////////
          >>
          >>
          >>
          >>
          >

          Comment

          Working...