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 6580513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:02:20+00:00 2026-05-25T16:02:20+00:00

I have a Java program which needs to be a startup program that runs

  • 0

I have a Java program which needs to be a startup program that runs as administrator. It seems that cannot be done without making it a service. I have tried using HKLM\SYSTEM\CurrentControlSet\Services\Services\MyService. I tried something similar to what Google Updater uses (they use ...\Services\gupdate). The process does not start (or at least it stops right away, which I cannot tell for sure.

I think it is something wrong with how I am using the registry because the service does not show up in msconfig.exe under the Services tab. Also it doe not show up in the Control Panel “View local services” (Windows 7, found in the Start Menu search for “services”)

I tried a much simpler approach found here. I create a .reg file with these contents.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService]
"Description"="My Service starts the Special Process."

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService\Parameters]
"Application"="C:\\Test\\MyProcess.cmd"

I am willing to consider an alternative command-line alternative if necessary, but I like the registry approach because if I tell my installer to add certain registry items, it will automatically remove those items on uninstall.

Is there any reason that above .reg file would not add an item to msconfig that is named “MyService”?

The program which I wrote is written in Java. It does not have a GUI interface.

  • 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-25T16:02:20+00:00Added an answer on May 25, 2026 at 4:02 pm

    You can’t create a service by manipulating the registry. Nor can you run an arbitrary application as a service.

    To run an arbitrary program from within a service, use the srvany.exe service available in the Windows Server 2003 resource kit. See KB137890 for instructions. If you want to write your own service, see this.

    To create a service you can use the sc command line tool, or the instsrv.exe tool from the Windows Server 2003 resource kit. Or use the CreateService Win32 API function.

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

Sidebar

Related Questions

I have a Java program which runs in Tomcat and which needs to execute
I have a java client program that uses mdns with service discovery to find
I have written a java program which needs to process thousands of text files
I currently have a small Java program which I would like to run both
We have a Perl program to validate XML which is invoked from a Java
I have a Java program that loads thirdparty class files (classes I did not
We have a java program that requires a large amount of heap space -
We have a Java program run as root on Unix, that therefore can read
Suppose that I have a Java program within an IDE (Eclipse in this case).
Let's say I have a java program that makes an HTTP request on a

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.