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. How to kill process using C#?

How to kill process using C#?

Scheduled Pinned Locked Moved C#
csharptutorialquestion
7 Posts 5 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.
  • D Offline
    D Offline
    DarkSorrow38
    wrote on last edited by
    #1

    My computer is affected by a virus 'regsvr.exe' which slows down the machine by eating proccessors time. I have to explicitly kill it from the process tab in the task manager. For this reason i want to create a executiable that would kill its process. Also specify how to put my executiable in the startup menu.

    N M B C 4 Replies Last reply
    0
    • D DarkSorrow38

      My computer is affected by a virus 'regsvr.exe' which slows down the machine by eating proccessors time. I have to explicitly kill it from the process tab in the task manager. For this reason i want to create a executiable that would kill its process. Also specify how to put my executiable in the startup menu.

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Why not just clean the virus off your machine? :rolleyes: and remember to practice safe computing in the future.


      only two letters away from being an asset

      1 Reply Last reply
      0
      • D DarkSorrow38

        My computer is affected by a virus 'regsvr.exe' which slows down the machine by eating proccessors time. I have to explicitly kill it from the process tab in the task manager. For this reason i want to create a executiable that would kill its process. Also specify how to put my executiable in the startup menu.

        M Offline
        M Offline
        Manas Bhardwaj
        wrote on last edited by
        #3

        Ishaan Karnik wrote:

        For this reason i want to create a executiable that would kill its process. Also specify how to put my executiable in the startup menu

        I would rather use a anti virus to do this.

        Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

        1 Reply Last reply
        0
        • D DarkSorrow38

          My computer is affected by a virus 'regsvr.exe' which slows down the machine by eating proccessors time. I have to explicitly kill it from the process tab in the task manager. For this reason i want to create a executiable that would kill its process. Also specify how to put my executiable in the startup menu.

          B Offline
          B Offline
          Blikkies
          wrote on last edited by
          #4

          You can use this:

          System.Diagnostics.Process.Start("tskill", "regsvr");<

          But it much beter to use anti-virus to remove the virus or any other viruses.

          D 1 Reply Last reply
          0
          • B Blikkies

            You can use this:

            System.Diagnostics.Process.Start("tskill", "regsvr");<

            But it much beter to use anti-virus to remove the virus or any other viruses.

            D Offline
            D Offline
            DarkSorrow38
            wrote on last edited by
            #5

            I don't have a anti-virus software installed currently and the virus is not letting the anti-virus software install one.

            B 1 Reply Last reply
            0
            • D DarkSorrow38

              I don't have a anti-virus software installed currently and the virus is not letting the anti-virus software install one.

              B Offline
              B Offline
              Blikkies
              wrote on last edited by
              #6

              Well this will do the job then:

              System.Diagnostics.Process.Start("tskill", "regsvr");

              1 Reply Last reply
              0
              • D DarkSorrow38

                My computer is affected by a virus 'regsvr.exe' which slows down the machine by eating proccessors time. I have to explicitly kill it from the process tab in the task manager. For this reason i want to create a executiable that would kill its process. Also specify how to put my executiable in the startup menu.

                C Offline
                C Offline
                carlecomm
                wrote on last edited by
                #7

                Hi, // you can kill process by PID Process p= Process.GetProcessById(PID); p.Kill();

                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