#1
  1. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154

    Ending Processes


    I'm currently trying to create a virus (ad-aware, spyware, trojans, etc.) remover. I already know how to remove the files that are listed in a text document (defs.dat). I'm pretty sure I can remove their registry values if they have any. My only problem is knowing how to end their process if they are running. Does Python have a way to end a certain process(s)?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    London, England
    Posts
    1,585
    Rep Power
    1373
    There is an os.kill function that will do exactly what you want, but it is only implemented on UNIX systems. I presume from your previous posts that you are Windows only.

    On Windows with the Win32 extensions installed you can use the win32process.ExitProcess or win32process.TerminateProcess functions, which calls the Windows function of the same names. The doc for the functions can be found on MSDN here and here.

    Dave - The Developers' Coach
    Last edited by DevCoach; February 6th, 2005 at 05:55 AM.

IMN logo majestic logo threadwatch logo seochat tools logo