Hello everyone,
From ServiceController class, we can easily get the names of all the services on the current system. My question is how to get the physical absolute path of the executable file for the service? I found quite a while in MSDN, but failed.
thanks in advance,
George

Ryan AlfordRank #1,411 · 1.2K reputationPosted Aug 25, 2008, 12:59 PM EDT
foreach(Process p in processes)
{
// This will give you the full path name of the process
string name = p.MainModule.FileName;
}
George GeorgeRank #1,736 · 870 reputationPosted Aug 25, 2008, 6:30 PM EDT
Cool, Ryan!
So, ServiceController does not have the capability to get the executable file name path, correct?
regards,
George
Ryan AlfordRank #1,411 · 1.2K reputationPosted Aug 26, 2008, 5:00 AM EDT
George GeorgeRank #1,736 · 870 reputationPosted Aug 26, 2008, 5:37 AM EDT
Thanks Ryan!
I think get executable file path is not supported directly in ServiceController class from the document sent to me. and itis why it needs to do something additional. Correct? :-)
regards,
George
Ryan AlfordRank #1,411 · 1.2K reputationPosted Aug 26, 2008, 6:23 AM EDT
George GeorgeRank #1,736 · 870 reputationPosted Aug 26, 2008, 6:04 PM EDT
Thanks Ryan!
Question answered.
regards,
George