Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8267845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:40:54+00:00 2026-06-08T05:40:54+00:00

I have a service that I need to be able to start and stop

  • 0

I have a service that I need to be able to start and stop with a button. I am using a ServiceController in a seperate program and everything works as intended when I run this seperate program as an administrator. However, I need to be able to control this service as anyone. How can I set the permissions for my service so that everyone has full control of it? This needs to be done programatically as either part of the service, or the install. It is a localservice written in vb.net.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:40:56+00:00Added an answer on June 8, 2026 at 5:40 am

    You have a few options:

    1) You can require that your application runs as an administrator. Every time your application starts, you will be prompted with the UAC (on Windows 7 and Vista) and your application will be elevated to the required level.

    Run .NET application as administrator

    2) Your application can request an elevation when the action is required to stop and start the service. It would do this by starting another application at a higher level and this other application will do the actual start and stop.

    How to elevate privileges only when required?

    3) Preferred option, IMHO – You should build your service to run all of the time but just not do anything other than listen for requests via TCP/IP, Named Pipes or some other communication mechanism. Your service can then start or stop a thread that performs the real work.

    4) You can modify the service rights. Here are some posts that give some information on this (I would still prefer option 3):

    Start / Stop a Windows Service from a non-Administrator user account

    http://msmvps.com/blogs/erikr/archive/2007/09/26/set-permissions-on-a-specific-service-windows.aspx

    http://fstaal01.home.xs4all.nl/swsc-us.html

    Update

    I have changed some text and added option 4 based on Harry’s comment. It seems that there are ways of tweaking the permissions. These require administrator rights initially but if you bundle something like swsc (third link) with your installation, you could use it to set the rights for you. I am not sure if there are any license implications for doing this. Alternatively, you could use a variant of the code he pasted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF service that I need to call in a ASP.NET web
I have a service class that I need to execute a method on a
I have a new service that I have written and need to register it
I have a WCF service that I am calling from multiple clients. I need
I need to have ALWAYS a background service that will synchronize my Android application
I have a synchronous web service call that returns a message. I need to
I have code that does a web-service request. While doing this request I need
I have written an android service, that I need to run in the background
Here is the premise: I have a desktop that I need to be able
I have a Service that sends an Intent to my Activity every 0.1 seconds.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.