How to find the full path of all opened files of different applications i.e Word, pdf reader or Excel?
I tried attached code, but only found the file names rather then complete path of files.
foreach (Process p in Process.GetProcessesByName("excel"))
try
{
if (p.MainWindowTitle.Length > 0)
{
Console.WriteLine("======================");
Console.WriteLine("Window Title:" + p.MainWindowTitle.ToString());
Console.WriteLine("Process Name:" + p.ProcessName.ToString());
Console.WriteLine("Window Handle:" + p.MainWindowHandle.ToString());
}
}
catch { }