S
sunil
Hi all,
I read an article from
http://www.c-sharpcorner.com/Code/2003/Sept/InstallingWinServiceProgrammatically.asp
about how to install a windows service programmatically.
Based on the code sample, it provides the feature to install
service
under LocalSystem account.
What I need is to install service under NT
AUTHORITY\NetworkService, so that my service can access the shared
network resources.
What I had done for this is to call
CreateService(sc_handle, serviceName, serviceDisplayName,
SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
SERVICE_AUTO_START, SERVICE_ERROR_NORMAL,
servicePath, null, 0, null, @NT AUTHORITY\NetworkService, "");
But the problem is that, the service is installed under LocalSystem
account inspite of being passing the parameter value as non-null.
Please help me.
I read an article from
http://www.c-sharpcorner.com/Code/2003/Sept/InstallingWinServiceProgrammatically.asp
about how to install a windows service programmatically.
Based on the code sample, it provides the feature to install
service
under LocalSystem account.
What I need is to install service under NT
AUTHORITY\NetworkService, so that my service can access the shared
network resources.
What I had done for this is to call
CreateService(sc_handle, serviceName, serviceDisplayName,
SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
SERVICE_AUTO_START, SERVICE_ERROR_NORMAL,
servicePath, null, 0, null, @NT AUTHORITY\NetworkService, "");
But the problem is that, the service is installed under LocalSystem
account inspite of being passing the parameter value as non-null.
Please help me.