Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

Here i Developed Windows Service.Its Working Fine in Adminstrator Account But when comes to User Logins the Windows Service Getting an Exception.The Exception is cannot open service computer.I have Checked with app manifest file.its working but i dont want to use appmanifest file.Trough Code i want to acess the administrative previlages.So if any Information Regarding this please share with me.

C#
foreach (ServiceController scrTemp in scr)
                {
                    if (scrTemp.ServiceName == "DEMIS_MSMS_SERVICE")
                    {
                      
                            flg = 1;
                            scrTemp.Refresh();
                            string str1 = scrTemp.Status.ToString();
                            if (str1 == "Running")
}
}

this is sample code but iam getting an exception cannot open DEMIS_MSMS_SERVICE on your computer
Regards,

Sravanthi
Posted
Updated 8-Jan-13 23:31pm
v2

1 solution

Services also have ACL-s. If you don't want to grant access to all services to a user, you can set up individual service control rights. You can use SetACL[^] for example (from command line or even from an application via i'ts COM interface) to set ACLs on Services.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900