How can I get a path of a running process by name? For example, I know there is a process named \"notepad\" running, and I want to get the path of it. How to get the path wi
There is a method GetProcessesByName that existed in .Net 2.0:
foreach (Process PPath in Process.GetProcessesByName("notepad")) { string fullpath = PPath.MainModule.FileName; Console.WriteLine(fullpath); }