Click here to Skip to main content
15,895,283 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help with serial data display Pin
NedPat10-Nov-10 19:38
NedPat10-Nov-10 19:38 
GeneralRe: Help with serial data display Pin
ShafiqA11-Nov-10 18:29
ShafiqA11-Nov-10 18:29 
GeneralRe: Help with serial data display Pin
Adam Yonce10-Nov-10 2:50
Adam Yonce10-Nov-10 2:50 
GeneralRe: Help with serial data display Pin
turbosupramk310-Nov-10 3:05
turbosupramk310-Nov-10 3:05 
NewsRe: Help with serial data display Pin
turbosupramk310-Nov-10 14:41
turbosupramk310-Nov-10 14:41 
AnswerRe: Help with serial data display Pin
davidwz9-Nov-10 19:04
davidwz9-Nov-10 19:04 
AnswerRe: Help with serial data display Pin
DarthDana10-Nov-10 4:59
professionalDarthDana10-Nov-10 4:59 
QuestionHow can I get the filename and sourcepath of a running process? Pin
Erik8-Nov-10 23:52
Erik8-Nov-10 23:52 
Hi,

I am using something like this to get all my running processes:

Process[] processlist = Process.GetProcesses();
foreach(Process theprocess in processlist)
{
       Console.WriteLine("Process: {0} ID: {1}", theprocess.ProcessName, theprocess.Id);
}


My problem is that I want to know the filename (EXE) of a process, and the pathname it was started from. For example, if there is a process Notepad.exe running, I want to determine in which folder that file actually resides, i.e. something like "C:\Windows\system32\notepad.exe". How can I get that information?

I already tried to get the member StartInfo. but it doesn't contain a link to the folder.

How can I do this?
AnswerMessage Closed PinPopular
9-Nov-10 0:15
stancrm9-Nov-10 0:15 
GeneralRe: How can I get the filename and sourcepath of a running process? Pin
RaviRanjanKr9-Nov-10 3:56
professionalRaviRanjanKr9-Nov-10 3:56 
AnswerRe: How can I get the filename and sourcepath of a running process? Pin
RaviRanjanKr9-Nov-10 3:55
professionalRaviRanjanKr9-Nov-10 3:55 
AnswerRe: How can I get the filename and sourcepath of a running process? Pin
Luc Pattyn9-Nov-10 4:10
sitebuilderLuc Pattyn9-Nov-10 4:10 
GeneralRe: How can I get the filename and sourcepath of a running process? Pin
RaviRanjanKr9-Nov-10 4:24
professionalRaviRanjanKr9-Nov-10 4:24 
GeneralRe: How can I get the filename and sourcepath of a running process? Pin
ShilpaKumari10-Nov-10 0:20
ShilpaKumari10-Nov-10 0:20 
GeneralRe: How can I get the filename and sourcepath of a running process? Pin
RaviRanjanKr10-Nov-10 1:29
professionalRaviRanjanKr10-Nov-10 1:29 
GeneralRe: How can I get the filename and sourcepath of a running process? Pin
AshishKr15-Nov-10 1:35
AshishKr15-Nov-10 1:35 
GeneralRe: How can I get the filename and sourcepath of a running process? Pin
MDNadeemAkhter9-Nov-10 16:59
MDNadeemAkhter9-Nov-10 16:59 
GeneralRe: How can I get the filename and sourcepath of a running process? Pin
RaviRanjanKr9-Nov-10 17:50
professionalRaviRanjanKr9-Nov-10 17:50 
QuestionDatagridview Pin
yesu prakash8-Nov-10 22:12
yesu prakash8-Nov-10 22:12 
AnswerRe: Datagridview Pin
TweakBird8-Nov-10 23:59
TweakBird8-Nov-10 23:59 
QuestionReplace assembly at runtime Pin
marca2928-Nov-10 21:43
marca2928-Nov-10 21:43 
AnswerRe: Replace assembly at runtime Pin
David Ewen8-Nov-10 22:07
professionalDavid Ewen8-Nov-10 22:07 
AnswerRe: Replace assembly at runtime Pin
John Gathogo8-Nov-10 22:08
John Gathogo8-Nov-10 22:08 
GeneralRe: Replace assembly at runtime Pin
marca2928-Nov-10 22:18
marca2928-Nov-10 22:18 
AnswerRe: Replace assembly at runtime Pin
Pete O'Hanlon9-Nov-10 1:54
mvePete O'Hanlon9-Nov-10 1:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.