473,396 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Finding Full Path to Process EXE

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
7 3766
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
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
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
Hi!

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

@-salutations

Michel Claveau

Mar 29 '08 #5
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Yang | last post by:
I want to list all images from a url. here is my code snippet which finds an image from a url: $url = "http://asdf.com/"; $text = @implode("", file($url)); while (eregi("*(src)*=*(+)",...
4
by: Hal Vaughan | last post by:
I want to have a config file for my program, which means I need to know where the config file is. If I type: java myclass and it runs myclass.class, is there any way to obtain the location of...
11
by: Fuzzyman | last post by:
What's the best, cross platform, way of finding out the directory a script is run from ? I've googled a bit, but can't get a clear answer. On sys.argv the docs say : argv is the script name...
4
by: m | last post by:
Hello I need to find out full URL of my application name, I tried using Request.ServerVariables but it returns only serverername, and I need virtual directory name as well. Thnx in advance
5
by: Jay | last post by:
Hello, I am writing a c++ program that stores some values in a config located in it's directory. is there a way in c++ to get the full path of the running program so I can open the file not...
4
by: Dots | last post by:
I have a class library with a method called getpath(). I want to be able to get the full path of a folder and write some files to the (my_files_dir) folder. A console application will use this...
17
by: NetworkElf | last post by:
Hi all, I'm writing a service that needs to discover the full directory path for a given locally based share at startup. IOW, I need to have the service running on someserver to take ...
4
by: somank.sharma | last post by:
I am running an exe created in C. I need the full path (absolute path) of this exe. In the first argument of main, I am getting the exe name. How can I get the full path for this exe.
2
by: tvjraman | last post by:
I've spent two days on google trying to find a suitable solution for getting the full path of the running process but in vain. My question is very simple. I want to know the full path of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.