473,761 Members | 5,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3778
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.comescri bió:
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 GetExtendedTcpT able 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 GetExtendedTcpT able 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
1691
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)*=*(+)", $text , $regs)) {
4
12368
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 the file myclass.class? Will this work if it's run from a relative path, like: java ../progs/myclass
11
2388
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 (it is operating system dependent whether this is a full pathname or not). So this doesn't seem to be the answer.
4
5429
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
1917
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 relative to where I run it from but where it is located? Thanks Jay
4
4070
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 class library. How can I do this so I wont have to hardcode this path in my getpath() method. Here is the path below. "C:\Inetpub\wwwroot\Web_mycontrol\my_Files_dir\" -- Dotty
17
1852
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 \\someserver\someshare and give me c:\somedir\somedir\shareddir. I'm not quite sure where to start reading about how to do this. Could someone give me a push in the right direction, please?
4
3027
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
3333
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 running Word instances. for example if I've 2 instances of Word running currently, I need to know the full path name including drives and directories.I can get the base exe file but not the full path i.e., I can easily get the C:\Program...
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.