By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,035 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,035 IT Pros & Developers. It's quick & easy.

Finding Full Path to Process EXE

P: n/a
Hello,

I would like to write a script that would enumerate all running
processes and return the full path to the EXE of each running
process. However, I can't seem to find any good info on how to do
this..any help is greatly appreciated. Thanks.

T
Mar 28 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
mi************@gmail.com wrote:
Hello,

I would like to write a script that would enumerate all running
processes and return the full path to the EXE of each running
process. However, I can't seem to find any good info on how to do
this..any help is greatly appreciated. Thanks.
I have this strange feeling of deja vu. Try this:

http://timgolden.me.uk/python/wmi_co...ning_processes

(You want the .ExecutablePath or .CommandLine attributes I imagine)

TJG
Mar 28 '08 #2

P: n/a
En Fri, 28 Mar 2008 16:40:01 -0300, <mi************@gmail.comescribió:
I would like to write a script that would enumerate all running
processes and return the full path to the EXE of each running
process. However, I can't seem to find any good info on how to do
this..any help is greatly appreciated. Thanks.
Use Tim Golden's WMI wrapper.
Searching for "python enumerate running processes" with Google returns a
reference to his module on the *first* hit. Searching in this newsgroup
only, returns tons of references.

--
Gabriel Genellina

Mar 28 '08 #3

P: n/a
On Mar 28, 4:53 pm, Tim Golden <m...@timgolden.me.ukwrote:
misceveryth...@gmail.com wrote:
Hello,
I would like to write a script that would enumerate all running
processes and return the full path to the EXE of each running
process. However, I can't seem to find any good info on how to do
this..any help is greatly appreciated. Thanks.

I have this strange feeling of deja vu. Try this:

http://timgolden.me.uk/python/wmi_co...ning_processes

(You want the .ExecutablePath or .CommandLine attributes I imagine)

TJG
Thanks, Tim! I was able to find plenty out there about enumerating
processes, but the .ExecutablePath was exactly what I needed.
Mar 29 '08 #4

P: n/a
Hi!

Warning : WMI give the "command-line" of a process only for windows >
2000

@-salutations

Michel Claveau

Mar 29 '08 #5

P: n/a
That's not a problem - I'm only interested in Win2k+. Thanks for the
caveat.

On a similar note, is there a way (preferably using WMI) to get the
full path to the executable that has a port open (the same thing that
fport does, just implemented in Python)?
Mar 30 '08 #6

P: n/a
mi************@gmail.com wrote:
That's not a problem - I'm only interested in Win2k+. Thanks for the
caveat.

On a similar note, is there a way (preferably using WMI) to get the
full path to the executable that has a port open (the same thing that
fport does, just implemented in Python)?
It looks as though it might be possible with the (not
installed by default) SNMP WMI provider. Haven't tried
it myself, but there's some info here:

http://groups.google.com/group/micro...1b8497826e4aea

and here:

http://msdn2.microsoft.com/en-us/lib...21(VS.85).aspx

Alternatively, look around for the GetExtendedTcpTable functionality
and so on.

Sorry, this isn't really my area -- all I've done here is to let
my fingers do the walking.

TJG
Mar 31 '08 #7

P: n/a
On Mar 31, 2:50 am, Tim Golden <m...@timgolden.me.ukwrote:
misceveryth...@gmail.com wrote:
That's not a problem - I'm only interested in Win2k+. Thanks for the
caveat.
On a similar note, is there a way (preferably using WMI) to get the
full path to the executable that has a port open (the same thing that
fport does, just implemented in Python)?

It looks as though it might be possible with the (not
installed by default) SNMP WMI provider. Haven't tried
it myself, but there's some info here:

http://groups.google.com/group/micro...rogrammer.wmi/...

and here:

http://msdn2.microsoft.com/en-us/lib...21(VS.85).aspx

Alternatively, look around for the GetExtendedTcpTable functionality
and so on.

Sorry, this isn't really my area -- all I've done here is to let
my fingers do the walking.

TJG
Sounds good - I'm going to check those links out now. Thanks again
for all your help.
Mar 31 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.