Answer the question
In order to leave comments, you need to log in
How to get the name of an open file from a process in windows?
I want to know the name of the process (ff.exe). How can I do that? It turns out only to find out what it is notepad.exe.
Tried in the spirit:
public static bool FileLocked(string id)
{
var process = Process.GetProcessesByName ("notepad.exe");
foreach (Process proc in process)
{
if (proc.MainModule.FileName == id)
return true;
}
return false;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question