Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Prevent killing an app through "End task"

Prevent killing an app through "End task"

Scheduled Pinned Locked Moved C#
tutorialquestion
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    James Poulose
    wrote on last edited by
    #1

    Hello, Can anyone tell me how to prevent my program being killed by pressing "End Task" of task manager ? I have seen that when we try to kill some apps it tells that we cannot terminate it, because of "some" reason. Thanks James

    D S 2 Replies Last reply
    0
    • J James Poulose

      Hello, Can anyone tell me how to prevent my program being killed by pressing "End Task" of task manager ? I have seen that when we try to kill some apps it tells that we cannot terminate it, because of "some" reason. Thanks James

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Basically, you can't prevent this. There are various reasons for not being able to kill the process, like the process is running under a priviledged or system account, is a system service where Windows cannot work without it, there is a debugger attached to the process, ... But in all these cases, you're application would not be running under these circumstances. I've "heard" of a couple people doing this, but noone has ever come up with any code examples demonstrating it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      R 1 Reply Last reply
      0
      • J James Poulose

        Hello, Can anyone tell me how to prevent my program being killed by pressing "End Task" of task manager ? I have seen that when we try to kill some apps it tells that we cannot terminate it, because of "some" reason. Thanks James

        S Offline
        S Offline
        Sebrell
        wrote on last edited by
        #3

        I'm really curious what you want this for.

        1 Reply Last reply
        0
        • D Dave Kreskowiak

          Basically, you can't prevent this. There are various reasons for not being able to kill the process, like the process is running under a priviledged or system account, is a system service where Windows cannot work without it, there is a debugger attached to the process, ... But in all these cases, you're application would not be running under these circumstances. I've "heard" of a couple people doing this, but noone has ever come up with any code examples demonstrating it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          R Offline
          R Offline
          Rei Miyasaka
          wrote on last edited by
          #4

          If you want to do this for a security program of some sort, you can have the program called under the user Administrator, and leave the computer on with a user account that doesn't have administrative rights. Another way, depending on what you're trying to do, might be to start the program as a Windows service, and again, use a user account that doesn't have access to the Services control panel.

          D 1 Reply Last reply
          0
          • R Rei Miyasaka

            If you want to do this for a security program of some sort, you can have the program called under the user Administrator, and leave the computer on with a user account that doesn't have administrative rights. Another way, depending on what you're trying to do, might be to start the program as a Windows service, and again, use a user account that doesn't have access to the Services control panel.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            Why are you telling me this? I didn't post the question. Also, I can't quite understand what your saying in the first paragraph, but it doesn't sound like a good idea. You NEVER use the Administrators account for anything other than system administration. Applications/Services/Servers should NEVER use this account. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            R 1 Reply Last reply
            0
            • D Dave Kreskowiak

              Why are you telling me this? I didn't post the question. Also, I can't quite understand what your saying in the first paragraph, but it doesn't sound like a good idea. You NEVER use the Administrators account for anything other than system administration. Applications/Services/Servers should NEVER use this account. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

              R Offline
              R Offline
              Rei Miyasaka
              wrote on last edited by
              #6

              Oops, sorry. Does a notification get sent to the original poster, or just to you? And you're right, Administrator isn't the rght place to do it. How about a user specifically for the task, like what ASP does? My bad on both the post and the idea.

              D 1 Reply Last reply
              0
              • R Rei Miyasaka

                Oops, sorry. Does a notification get sent to the original poster, or just to you? And you're right, Administrator isn't the rght place to do it. How about a user specifically for the task, like what ASP does? My bad on both the post and the idea.

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Only the person you reply to gets a notification email. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups