Search code examples
pythonprocesssubprocesswindows-xp-sp3

Listing Windows XP processes using Python


I want to list the process running on Windows XP using a Python program. I would love to have a similar list to the one that the windows task manager shows. I know this is possible with a Unix system, but I am not sure if subprocess Python's module can perform this for a Windows XP operating system ? Mainly, I want retrieving those processes using Python and save them into a text file.


Solution

  • I think you need Windows Management Instrumentation. It is a Python module that handles lot of tasks, including the one you mentioned.

    As the link shows, you may list all the running processes. You can also list the processes that only a given program runs.