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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code Security and ExecuteCommand

Status
Not open for further replies.

Akusei

Programmer
Jul 15, 2003
90
US
I am trying to use ServiceController.ExecuteCommand on the service that I have created. The service has overridden the OnCustomCommand() method and all should work well... Except when I call ExecuteCommand from my windows application it throws an exception saying that it could not control the service because Access Denied.

I think it has something to do with the .Net framework code security because in the documentation for ExecuteCommand it mentions this, but I have no idea how to use it. Any ideas?

Error:
System.InvalidOperationException: Cannot control "myservicename" service on computer '.'. ---> System.ComponentModel.Win32Exception: Access is denied

Oh, and the current user logged in is a local and domain administrator.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top