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
Post a Comment