tags:

views:

28

answers:

1

Is it possible to find out through .Net whereabouts a service is installed to?

var temp = from sc in ServiceController.GetServices()
where sc.ServiceName == "MSSQL$SQLEXPRESS"
select sc;

However the servicecontroller doesn't give me the path I want, notably the "Path to Execute" found in the service properties dialog.

+1  A: 

I used this code

MegaHerz
Thanks! Works a treat!
wonea