The following code is throwing Exception. I don\'t get what mistake I am making in the code. Can somebody help me figure out please. I think it is of some security rights issue.
GetServiceHandle
requires some access rights. If it works when you run it as an Admin user, but not as a normal user, then maybe this article can help.
It clearly shows you how to manually give a Windows User rights to start and stop services (or set other permissions):
http://thommck.wordpress.com/2011/12/02/how-to-allow-non-admins-to-start-and-stop-system-services/