Registering any EXE program as a Windows system service

Source: Internet
Author: User
Tags net command

A GAE agent software will need to start each time manually, even if added as a boot entry, In the win8.1 under the authority of more stringent management, boot and can not successfully start the software (unattended when the power on), so in the online search EXE registered as a system service approach, to find the forum two posts, you can register the agent system service boot automatically start without each restart of the system to manually start the program. This experience is not original, the content from the above two posts.

Tools/Materials
    • Instsrv.exe (can provide system installation and removal services)
    • Srvany.exe (can let the program run as a service)
  1. instsrv.exe--a gadget from Windows Resource kits

    Microsoft's official description of the gadget:
    Installs and uninstalls executable services and assigns names to them.
    Obviously, this gadget is used to install and uninstall executable services and assign service names to these executable services.
    So how to use it? Here we set the F:\cpu.exe to be displayed as a service with the name Cpusrv, we should do this like this:
    First put Instsrv.exe into any directory, we have two ways to execute this command
    A, cmd method
    1. Click "Run" on the Start menu and type "cmd" (without double quotation marks) and click the OK button
    2, use the CD command in CMD to enter the Instsrv.exe directory or directly enter the Instsrv.exe specific path. For example Instsrv.exe in the F:\Tools directory, we should do this like this:
    Enter the directory after you type cd F:\tools
    Type Instsrv cpusrv F:\cpu.exe Enter
    Or you can
    Enter F:\tools\instsrv.exe cpusrv F:\cpu.exe directly after entering
    3, the service is installed, but at this time the service is not started, we can use the Net command to start the service
    It's still in CMD.
    Type net start Cpusrv and then enter
    4, started the service, we can also set the service startup type
    It's still in CMD.
    Type sc config cpusrv start= Auto auto start mode
    Type sc config cpusrv start= demand manual start mode
    Type sc config cpusrv start= disabled disabled boot mode

    B, Gui method
    1. Click "Run" on the Start menu
    2. In the Run text box, type
    F:\tools\instsrv.exe Cpusrv F:\cpu.exe
    Click the OK button


    3, the installation of services, start the service
    Click "Run" on the Start menu and type "Services.msc" (excluding double quotes) and click the OK button
    4. Right-click on a service named Cpusrv in the service to perform a start § Stop § Restart menu command. You can set the startup type by double-clicking Enter.

    If we want to remove this service, follow the steps above and we perform
    Instsrv.exe cpusrv REMOVE
    You can delete the service
    Note: Do not use this tool to remove system-related services!

    We can also use this gadget to create a service and set the command format to start the service with an account login:
    Instsrv cpusrv F:\cpu.exe-a your account name-p password

Registering any EXE program as a Windows system service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.