How to Kill a Process By Name in Python


This thread finally pointed out the fact that Mark Hammond’s Python for Windows extensions includes a demonstration of killing processes on Windows:

On my PC:
C:\Python24\Lib\site-packages\win32\scripts\killProcName.py

Keep in mind when using this that you should leave the .exe off of process names, and the process names are case sensitive.

My searches on this:

  1. python kill a process
  2. python XP find PID of a process
  3. win32api.TerminateProcess
  4. python XP kill process by name

[tags]python, win32, processes, kill, thread[/tags]

Comments are closed.