how can i install a service under a different account than the LocalSystem account using win32 api

Posted by taher chhabrawala on Stack Overflow See other posts from Stack Overflow or by taher chhabrawala
Published on 2010-05-20T07:27:35Z Indexed on 2010/05/20 7:30 UTC
Read the original article Hit count: 259

Filed under:
|
|
|

hi i am using the following code to install the service, i want to install this service under a different account, the last two parameters takes username and password but when i give so it throws an error...is there any specific way of giving username password here?

IntPtr sv_handle = CreateService(sc_handle, svcName, svcDispName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, svcPath, null, 0, null, null, null);

© Stack Overflow or respective owner

Related posts about c#

Related posts about win32