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

  • Home
  • SEARCH
  • 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 835201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:47:21+00:00 2026-05-15T04:47:21+00:00

How can I install a service under a different account than the LocalSystem account

  • 0

How can I install a service under a different account than the LocalSystem account using Win32 API?

I am using the following code to install the service. I want to install this service under a different account. The last two parameters take username and password but when I give so it throws an error. Is there any specific way of giving username and 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);
  • 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-05-15T04:47:22+00:00Added an answer on May 15, 2026 at 4:47 am

    What format are you using for lpServiceStartName?

    It needs to be machinename\\username (or .\\username) if the user name is local or part of a workgroup otherwise it should be domainname\\username.

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

Sidebar

Related Questions

How can I install the web service using installutil.exe? I get a Windows Service
How i can install the CDT plug-in (that you can develop in C++ under
I am trying to determine why a .Net service that I can successfully install
I am trying to install a simple java application as a windows service using
Is there any framework I can Instal on windows azure and get a service
Can you install and run your own windows services on ec2? Does it have
I would like to know if I can install IIS 7.5 on Windows Server
I am creating a Rails app for work and until I can install the
I've got a ClickOnce application deployed that many machines can install just fine -
I am on OSX Snow Leopard (10.6.2) I can install anything I need to.

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.