Create a background system service for a windows Application

Source: Internet
Author: User

This article describes how to turn an application in windows into a background system service for startup. The detailed steps are as follows: 1、srvany.exe(you can use 2、srvinstw.exe(create a service tool named %3%instsrv.exe (same as SRVINSTW. EXE, which can only be implemented using command lines and can be replaced with SRVINSTW. if you use the command line, you can create batch processing files to create faster and more concealed files.) www.2cto.com
There are two types of applications, one of which can be used directly when the service runs. In addition, if you cannot run the service, you can skip to srvany.exe and jump to the running process: srvinstancesexeto create a service. This means you can run srvany.exe, change the registration table, and direct the program to srvany.exe. When the service is started, there will be two more steps, one is srvany.exe, and the other is the application to be run. Srvinstancexeis easy to use. Instead, instsrv.exe?srvany.exe is directly used to describe how to install it: Save the two programs in a convenient location, such as the C root directory. For example, we add OutlookExpress as a service to the Windows XP Professional operating system and name this service "test ". Enter "CMD" during running, press enter, open the command line window, enter "c: \ instsrv.exe test c: \ srvany.exe" at the end of the prompt, and press enter, where "c: \ instsrv.exe "and" c: \ srvany.exe "indicate the locations where the two programs are stored, and test indicates the name of the service you want to add. Run Regedit to open the Registry Editor. under HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services, find the test you just added, right-click it, create an item, name it "Parameters", and click the new Parameters, create a new sub-key named "Application". The data type is "REG_SZ", and the value is the location of the program to be run as the service, if your Windows system is installed on drive C, the Program location of OutlookExpress is C: \ Program Files \ Outlook Express \ msimn.exe www.2cto.com. You can create a reg file to directly modify the import: [HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ test \ Parameters] "Application" = "C: \ Program After Files \ Outlook Express \ msimn.exe "is created, perform a test in the service. In the attribute," allow service to interact with the desktop "is tested. Note that if you use a batch processing file as an application, you need to test whether an application will be added every time you restart the service, after the test, determine whether to "allow service interaction with the desktop" based on the actual situation ". Author wang7dao

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.