Reading Command Line Arguments of Another Process (Win32 C code)

后端 未结 5 1582
甜味超标
甜味超标 2020-12-16 02:41

I need to be able to list the command line arguments (if any) passed to other running processes. I have the PIDs already of the running processes on the system, so basically

5条回答
  •  清酒与你
    2020-12-16 03:18

    By using psutil ( https://github.com/giampaolo/psutil ):

    >>> import psutil, os
    >>> psutil.Process(os.getpid()).cmdline()
    ['C:\\Python26\\python.exe', '-O']
    >>> 
    

提交回复
热议问题