SC for Batch Processing

Source: Internet
Author: User

Author: netpatch
Source: evil baboons China

Note:
Batch version -- SC

First of All, I would like to thank zzzEVAzzz for compiling this batch program based on the materials in his published Do All in Cmd Shell!
The principle is based on the functions of the INF file (for more information about the inf file, see the help document of DDK .) Compiled automatically!
The difficulty is very low. I wrote this batch program in just 10 minutes. (You can't laugh at it ......)

Usage:

The installation service syntax is:
Np service name/a service display name service description the Startup type to be added to the Service Program address/s
Example:
For example, if you want to install a service named test, the Service display name is: This is test. The service description is: experimentation.
The program path to be added as the service is c: \ winnt \ system32 \ test.exe. The Startup type is automatic and starts immediately after installation.

First copy test.exe to c: \ winnt \ system32 \
Then execute:
Np test/a "This is test" experimentation 2 c: \ winnt \ system32 \ test.exe/s
After execution, test.exe will be automatically installed as a service and started immediately!

Uninstall service Syntax:
For example, the service named test to be uninstalled
Then:
Np text/x
Press enter.

Note: by default, the program is installed only and cannot be started immediately! The installation starts immediately after the/s parameter is added!

Please do not use this program for illegal use! Otherwise, the user is responsible for all consequences!
Reprinted!
If you want to reprint it, make sure the content is complete! Thank you!

Appendix: Batch Processing content

Copy codeThe Code is as follows: _ content> @ echo off
Cls
Color f2
: Go
If "% 1" = "" goto use
If "% 2" = "" goto use
If "% 2" = "/a" goto az
If "% 2" = "/x" goto xz
: Az
If "% 5" = "" goto use
If "% 6" = "" goto use
Echo [Version]> c: \ az. inf
Echo Signature = "$ windows nt $"> c: \ az. inf
Echo [defainstall install. Services]> c: \ az. inf
Echo AddService = % 1, My_AddService_Name> c: \ az. inf
Echo [My_AddService_Name]> c: \ az. inf
Echo DisplayName = % 3> c: \ az. inf
Echo Description = % 4> c: \ az. inf
Echo ServiceType = 0x10> c: \ az. inf
Echo StartType = % 5> c: \ az. inf
Echo ErrorControl = 0> c: \ az. inf
Echo ServiceBinary = % 6> c: \ az. inf
Rundll32.exe setupapi, InstallHinfSection DefaultInstall 128 c: \ az. inf
Del c: \ az. inf
If "% 7" = "" goto exit
If "% 7" = "/s" net start % 1
Goto exit
: Xz
Net start | find "% 1"> nul & net stop % 1
Echo [Version]> c: \ xz. inf
Echo Signature = "$ windows nt $"> c: \ xz. inf
Echo [defainstall install. Services]> c: \ xz. inf
Echo DelService = % 1> c: \ xz. inf
Rundll32.exe setupapi, InstallHinfSection DefaultInstall 128 c: \ xz. inf
Del c: \ xz. inf
Goto exit
: Use
Echo *************************************** ***************************************
Echo ** install the service batch process **
Echo ****
Echo ** installation example :**
Echo ****
Echo ** np service name/a service display name service description the program address of the Startup type to be added as a service **
Echo ** Startup Type: 0 loaded during system boot and 1 loaded during OS initialization **
Echo ** 2 is automatically started by SCM (Service Control Manager), 3 is manually started, and 4 is disabled. **
Echo ****
Echo ** uninstall example :**
Echo ****
Echo ** np service name/x **
Echo ****
Echo ** build by NetPatch (N/P) QQ: 251592982 **
Echo ** 2005-4-07 **
Echo *************************************** ***************************************
Cmd/k
: Exit

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.