New
#1
Unable start a service when UAC is Default (ON)
Hi Friends,
I created a new Windows Service using C#. And Created a windows application to CREATE SERVICE, START SERVICE, STOP SERVICE and DELETE the SERVICE. This application is working fine when the UAC is turned OFF. When the UAC is
turned ON then none of the above operations are working.
1. Can i create a Service without Admin Rights, for creating am using the following
IntPtr sc_handle = OpenSCManager(null, null, SC_MANAGER_CREATE_SERVICE);
if (sc_handle.ToInt32() != 0)
{
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);
CloseServiceHandle(sc_handle);
}
[DllImport("Advapi32.dll")]
public static extern IntPtr CreateService(IntPtr SC_HANDLE, string lpSvcName, string lpDisplayName, int dwDesiredAccess, int dwServiceType, int dwStartType, int dwErrorControl, string lpPathName, string lpLoadOrderGroup, int lpdwTagId, string lpDependencies, string lpServiceStartName, string lpPassword);
2. Can i start the Service without admin Rights
Can any one please tell me how to solve this issue.
Regards,
Nidheesh