command line of a process.exe on another host
gnewsg at gmail.com
Fri Jun 12 06:47:53 EDT 2009
On 12 Giu, 00:18, "Harry" <h... at pillai.co.uk> wrote:
> HI ,
> I have number of process run on different windows servers which run's with
> different command line parameters. for example "process.exe -input<ddd>
> statusurl:http://sss.com"., These parameters can vary from host to host.
> using Psexec I know the PID and process name which are running on these
> machines, but how I can read the command line parameters of these process.
> Is there a way to read these command line of the proess via python pls?
> any feedback appreciated..
You can easily do this with psutil :
>>> import psutil, os
>>> p = psutil.Process(os.getpid())
Since psutil uses the native Windows calls to retrieve such kind of
info it's a lot faster than using any WMI-based solution.
More information about the Python-list