Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve path and account info for services

Status
Not open for further replies.

softwarescience

Programmer
Dec 7, 2001
71
GB
Using the 'ServiceProcess.ServiceController' namespace and class I can get almost all the information I want regarding services and devices, and manipulate them.
However, (as usual with .Net) the last bit of information I need is the actual path of the service and the account it runs under, which I cannot seem to find. I would prefer NOT to have to revert to the standard APIs.

Does anyone have any idea on how to retrieve this information (preferably without using the 'System.Management' namespace unless I really have to (it's too convoluted)).

Many thanks

 
See thread796-569241 for getting the path and check the regsitry value "ObjectName". I believe it contains the account name.

K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top