473,320 Members | 1,853 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,320 software developers and data experts.

How to get the full path of a running process

Hi,
How can I obtain the full path for a running process without using WMI? I've tried to use the Process.StartInfo.WorkingDirectory but it's not valid since the process is already running.

Thanks,
Nov 16 '05 #1
7 10784
Christopher,

are you looking for Application.ExecutablePath Property or something else?

HTH
Alex

"Christopher Attard" <Christopher At****@discussions.microsoft.com> wrote in
message news:68**********************************@microsof t.com...
Hi,
How can I obtain the full path for a running process without using WMI? I've tried to use the Process.StartInfo.WorkingDirectory but it's not
valid since the process is already running.
Thanks,

Nov 16 '05 #2
System.Windows.Forms.ApplicationPath

[..or..]

System.Reflection.Assembly.GetEntryAssembly().Loca tion

Chris
Nov 16 '05 #3
I'm searching for the WorkingDirectory of all the currently-running
processes on a machine.

Chris

"Chris" <ct******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
System.Windows.Forms.ApplicationPath

[..or..]

System.Reflection.Assembly.GetEntryAssembly().Loca tion

Chris

Nov 16 '05 #4
Environment.CurrentDirectory

sorry for the confusion, I believe that's what you're looking for.

Chris

"Christopher Attard" <ch*********@gfi.com> wrote in message
news:u9*************@TK2MSFTNGP11.phx.gbl...
I'm searching for the WorkingDirectory of all the currently-running
processes on a machine.

Chris

"Chris" <ct******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
System.Windows.Forms.ApplicationPath

[..or..]

System.Reflection.Assembly.GetEntryAssembly().Loca tion

Chris


Nov 16 '05 #5
Hi,

I think that WMI is the only way then , but I'm not 100% sure of it. Do a
google search

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Christopher Attard" <ch*********@gfi.com> wrote in message
news:u9*************@TK2MSFTNGP11.phx.gbl...
I'm searching for the WorkingDirectory of all the currently-running
processes on a machine.

Chris

"Chris" <ct******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
System.Windows.Forms.ApplicationPath

[..or..]

System.Reflection.Assembly.GetEntryAssembly().Loca tion

Chris


Nov 16 '05 #6
Take a look also at ProcessModule class and its FileName property. You can
obtain it with Process.MainModule property.

HTH
Alex

"Chris" <ct******@hotmail.com> wrote in message
news:uG**************@tk2msftngp13.phx.gbl...
Environment.CurrentDirectory

sorry for the confusion, I believe that's what you're looking for.

Chris

"Christopher Attard" <ch*********@gfi.com> wrote in message
news:u9*************@TK2MSFTNGP11.phx.gbl...
I'm searching for the WorkingDirectory of all the currently-running
processes on a machine.

Chris

"Chris" <ct******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
System.Windows.Forms.ApplicationPath

[..or..]

System.Reflection.Assembly.GetEntryAssembly().Loca tion

Chris



Nov 16 '05 #7
AlexS, thanks for your solution. Infact Process.MainModule does what I've
been looking for.

Chris

"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:Ov*************@TK2MSFTNGP11.phx.gbl...
Take a look also at ProcessModule class and its FileName property. You can obtain it with Process.MainModule property.

HTH
Alex

"Chris" <ct******@hotmail.com> wrote in message
news:uG**************@tk2msftngp13.phx.gbl...
Environment.CurrentDirectory

sorry for the confusion, I believe that's what you're looking for.

Chris

"Christopher Attard" <ch*********@gfi.com> wrote in message
news:u9*************@TK2MSFTNGP11.phx.gbl...
I'm searching for the WorkingDirectory of all the currently-running
processes on a machine.

Chris

"Chris" <ct******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> System.Windows.Forms.ApplicationPath
>
> [..or..]
>
> System.Reflection.Assembly.GetEntryAssembly().Loca tion
>
> Chris
>
>



Nov 16 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hayato Iriumi | last post by:
Hello, I have a need to kill a process. It sounds each enough, but the problem is that I have multiple executables running from different paths. Say, I have MyService.exe running from C:\FolderA...
2
by: Sridhar | last post by:
Hi, I have a web form where it has a <input type=file id=file1> control. I have an Upload button to upload the file. WHen I click on browse and select one file, it is showing the full file path...
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...
7
by: gmax2006 | last post by:
Hi, I use RedHat linux. How can I find where exactly the current python script is running? I use this code: #test.py import os,sys
4
by: =?Utf-8?B?WWFlbA==?= | last post by:
Hi, I want to check if in this computer have outlook a programe. If yes --> System.Diagnostics.Process.Start ("OUTLOOK.EXE"); How to check if no?? if no --some msg... How can I check it? How...
3
by: Shaswati | last post by:
Hi All, I need a windows utility which can get me the command line path for a process. Say I have an application which has a java.exe process running, it should return me the install directory for...
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...
7
by: misceverything | last post by:
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.