Click here to Skip to main content
11,923,046 members (65,703 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# C#4.0
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.

foreach (ServiceController scrTemp in scr)
                    if (scrTemp.ServiceName == "DEMIS_MSMS_SERVICE")
                            flg = 1;
                            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

Posted 9-Jan-13 0:30am
Edited 9-Jan-13 0:31am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151125.3 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100