0

In linux, I know with 'ps' you can get the arguments that a command was run with. I need the equivalent in windows

Right now in python I'm doing
Process[i] = subprocess.Popen(cmd + " --daemon --config " + str(i) + ".conf", shell=False)

But I'm doing this in a daemon that is meant to be up all (or most) of the time. Since I'm having to debug and modify this daemon regularly it's starting up 3 processes; but when I shut it down, the processes stay up. (like should happen, just in case)...

When I start it back up again, I need to re-map the PID to the config file used by the processes that already exist, but I don't know of any way of retrieving this information (and parsing it) in windows. Does such a thing exist?

Nosredna
  • 83,000
  • 15
  • 95
  • 122
ThantiK
  • 1,582
  • 4
  • 17
  • 31

1 Answers1

1

This one might give you some inspiration.

Community
  • 1
  • 1
fhe
  • 6,099
  • 1
  • 41
  • 44
  • Thanks! - It led me to pywin32 + WMI python module; which has the ability to read processes and...even has a .commandline function! – ThantiK Nov 30 '09 at 18:38