Hi,
i need path of all running application. if we have two ms-word doc file, so how i can find path of this two file. i find path of notepad using
ManagementClass MgmtClass = new ManagementClass("Win32_Process");
and CommandLine property. it gives only path of notepad allpication only, but not work in the case of word,xls file.
plz help me

DanPosted Apr 30, 2008, 7:01 PM
- not sure if I understand exactly what you're asking - but if I do then something like this might work:
string currentProcess;
int searchCount = 0;
Array processArray = Process.GetProcesses();
searchCount = 0;
itIsRunning = false;
while (searchCount < processArray.Length)
{
currentProcess = processArray.GetValue(searchCount).ToString();
if (currentProcess == "System.Diagnostics.Process (the_process_I_am_looking_for)")
{
itIsRunning = true;
searchCount = processArray.Length;
}
searchCount++;
}