Hi all,
I have tried in two ways
Solution1:-
code:- Process proc = Process.GetProcessById(pid);
string process_description= proc.MainModule.FileVersionInfo.FileDescription
Problem:-when we trying to access the MainModule property for some processes 0(idle), 4(system) or services(Having admin acces rights)
(most likely those running under SYSTEM credentials) on which user don't have the permission leads to win32 ACCESS DENIED EXCEPTION.
Solution 2:-
code :- string process_description=FileVersionInfo.GetVersionInfo(modulePath).FileDescription;
Problem :-Unable to get process decription if it was not mention in the properties of exe file or process which have admin rights .
For example:if process is google chrome.
ImageName:-chrome.exe Description :Google chrome
I want to get the description not the Image Name.
Can any one share your ideas how to get process description in taskmanager for particular process id.
Loading
VulpesPosted Jul 10, 2014, 6:45 AM
http://msdn.microsoft.com/en-gb/library/windows/desktop/ms647003(v=vs.85).aspx
which is called behind the scenes by .NET's FileVersionInfo class.
So the approaches mentioned in your opening post are on the right lines here and the Win32_Process WMI class won't help.
This is working fine on my machine:
and so I can only suggest that you give your users the appropriate access rights to avoid the exception. I doubt whether there's any way to circumvent this.
q swPosted Jul 10, 2014, 4:39 AM
'm using WMI query to get a list of all processes, but what i missing is process description! It appears like this when i use "Description" property!
but it should be
So what's the property name that return process description?
padmaPosted Jul 10, 2014, 4:22 AM
Guest UserPosted Jul 10, 2014, 4:10 AM