c# - Discover associated files of a certain process through WMI? -


is possible determine process (id), files associated (i.e. executable file files accessed process)?

i have use wmi unless there no other option avoid ntquerysysteminformation. have piece of code can determine file, processes using it. need efficient way opposite direction.

thank much.

i cannot find wmi if process local, can use modules of system.diagnostics.process class.

process[] processesbyname = process.getprocessesbyname("myexe.exe"); foreach (processmodule module in processesbyname[0].modules) {     console.writeline(module.filename); }  

Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -