China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-04 03:17
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to start a service with batch processing? View 2,328 Replies 9
Original Poster Posted 2006-09-23 19:57 ·  中国 江西 赣州 电信
高级用户
★★
论坛上抢劫的
Credits 551
Posts 246
Joined 2006-09-21 12:35
19-year member
UID 63270
Status Offline
I want to use batch processing to start XP system services, but I don't know how to do it!!! I can only use batch processing to change the startup type at present!!! As follows:
Floor 2 Posted 2006-09-23 20:00 ·  中国 江西 赣州 电信
高级用户
★★
论坛上抢劫的
Credits 551
Posts 246
Joined 2006-09-21 12:35
19-year member
UID 63270
Status Offline
Who else can tell me what services each of these abbreviations represents!!
Floor 3 Posted 2006-09-23 21:51 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Start XP system services using batch processing: sc or net commands
Floor 4 Posted 2006-09-23 21:52 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
The file says to set a service to automatic, manual, or disabled
Floor 5 Posted 2006-09-24 07:23 ·  中国 重庆 电信
初级用户
Credits 45
Posts 17
Joined 2006-09-23 13:24
19-year member
UID 63469
Status Offline
from: http://www.onegreen.net/Article_Print.asp?ArticleID=257
===============

Add a service:


Signature="$WINDOWS NT$"

AddService=inetsvr,,My_AddService_Name

DisplayName=Windows Internet Service
Description=Provides support for managing Internet information services.
ServiceType=0x10
StartType=2
ErrorControl=0
ServiceBinary=%11%\inetsvr.exe

Save as inetsvr.inf, then:

rundll32.exe setupapi,InstallHinfSection DefaultInstall 128 c:\path\inetsvr.inf

This example adds a service named inetsvr (it's a lot like the system's own services, heh heh).

Some notes:
1. The last four items are respectively
Service type: 0x10 is an independent process service, 0x20 is a shared process service (such as svchost);
Start type: 0 loaded at system boot, 1 loaded during OS initialization, 2 automatically started by SCM (Service Control Manager), 3 started manually, 4 disabled.
(Note that 0 and 1 can only be used for drivers)
Error control: 0 ignore, 1 continue and warn, 2 switch to LastKnownGood settings, 3 blue screen.
Service program location: %11% means system32 directory, %10% means system directory (WINNT or Windows), %12% is driver directory system32\drivers. Other values refer to DDK. You can also use the full path directly without variables.
These four items are necessary.
2. In addition to the six items in the example, there are LoadOrderGroup, Dependencies, etc. They are not commonly used so not introduced.
3. There are two commas after inetsvr because an infrequently used parameter flags is omitted in the middle.

Delete a service:


Signature="$WINDOWS NT$"

DelService=inetsvr
Floor 6 Posted 2006-09-24 07:33 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
1. To find out what services they represent, you can try the following command:
wmic service get caption,Description

Or directly run services.msc to view its description.
2. The most common way to start a service is to use the net start and sc start commands. You can add /? to view its help, or refer to "Help and Support".
Floor 7 Posted 2006-09-25 04:06 ·  新加坡 腾讯云
初级用户
Credits 73
Posts 30
Joined 2006-09-18 08:35
19-year member
UID 62944
Status Offline
::Start a service, such as Telnet:
::---------by MOBO
WMIC SERVICE where caption='TELNET' CALL STARTSERVICE
Floor 8 Posted 2006-12-05 04:57 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 9 Posted 2007-04-11 01:51 ·  中国 山东 青岛 电信
新手上路
Credits 2
Posts 1
Joined 2005-11-14 00:26
20-year member
UID 45199
Status Offline
Bump
Floor 10 Posted 2007-04-11 02:06 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
Originally posted by Must Love at 2006-12-4 15:57:
sc server start
You can start the service


Got it backwards

sc start server
Forum Jump: