Returns information about all the processes running on a computer.

This script was tested using Python 2.2.2-224 for Microsoft Windows, available from ActiveState.

Python
Edit|Remove
import win32com.client
strComputer = "."
objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator")
objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2")
colItems = objSWbemServices.ExecQuery("Select * from Win32_Process")
for objItem in colItems:
    print "Caption: ", objItem.Caption
    print "Command Line: ", objItem.CommandLine
    print "Creation Class Name: ", objItem.CreationClassName
    print "Creation Date: ", objItem.CreationDate
    print "CS Creation Class Name: ", objItem.CSCreationClassName
    print "CS Name: ", objItem.CSName
    print "Description: ", objItem.Description
    print "Executable Path: ", objItem.ExecutablePath
    print "Execution State: ", objItem.ExecutionState
    print "Handle: ", objItem.Handle
    print "Handle Count: ", objItem.HandleCount
    print "Install Date: ", objItem.InstallDate
    print "Kernel Mode Time: ", objItem.KernelModeTime
    print "Maximum Working Set Size: ", objItem.MaximumWorkingSetSize
    print "Minimum Working Set Size: ", objItem.MinimumWorkingSetSize
    print "Name: ", objItem.Name
    print "OS Creation Class Name: ", objItem.OSCreationClassName
    print "OS Name: ", objItem.OSName
    print "Other Operation Count: ", objItem.OtherOperationCount
    print "Other Transfer Count: ", objItem.OtherTransferCount
    print "Page Faults: ", objItem.PageFaults
    print "PageFile Usage: ", objItem.PageFileUsage
    print "Parent Process Id: ", objItem.ParentProcessId
    print "Peak PageFile Usage: ", objItem.PeakPageFileUsage
    print "Peak Virtual Size: ", objItem.PeakVirtualSize
    print "Peak Working Set Size: ", objItem.PeakWorkingSetSize
    print "Priority: ", objItem.Priority
    print "Private Page Count: ", objItem.PrivatePageCount
    print "Process Id: ", objItem.ProcessId
    print "Quota NonPaged Pool Usage: ", objItem.QuotaNonPagedPoolUsage
    print "Quota Paged Pool Usage: ", objItem.QuotaPagedPoolUsage
    print "Quota Peak NonPaged Pool Usage: ", objItem.QuotaPeakNonPagedPoolUsage
    print "Quota Peak Paged Pool Usage: ", objItem.QuotaPeakPagedPoolUsage
    print "Read Operation Count: ", objItem.ReadOperationCount
    print "Read Transfer Count: ", objItem.ReadTransferCount
    print "Session Id: ", objItem.SessionId
    print "Status: ", objItem.Status
    print "Termination Date: ", objItem.TerminationDate
    print "Thread Count: ", objItem.ThreadCount
    print "User Mode Time: ", objItem.UserModeTime
    print "Virtual Size: ", objItem.VirtualSize
    print "Windows Version: ", objItem.WindowsVersion
    print "Working Set Size: ", objItem.WorkingSetSize
    print "Write Operation Count: ", objItem.WriteOperationCount
    print "Write Transfer Count: ", objItem.WriteTransferCount