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-11 12:46
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Which services are standalone View 1,546 Replies 15
Original Poster Posted 2009-02-24 19:32 ·  中国 北京 联通
中级用户
★★
Credits 313
Posts 162
Joined 2007-04-02 06:45
19-year member
UID 83693
Gender Male
Status Offline
A question: which system services are standalone, with no dependencies? If you're replacing a system service program, it should be a standalone service.

[ Last edited by ooaf on 2009-2-26 at 10:15 ]
Floor 2 Posted 2009-02-24 20:15 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
What you're looking for is RunAsSrv, right

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 3 Posted 2009-02-24 20:16 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
Run As Service

- A tool for running any executable file (including batch files and scripts) as a system service

- Run Everything As a System Service

Run any executable file as a system service.
At first it was mainly for porting some Linux daemons; it can also be used to start any application and maintenance scripts.
Runs quietly; unless Interactive mode is specified, no window will pop up.
No login required; it runs automatically after system startup, without waiting for the user to finish logging in.
As an extra feature, it supports starting, stopping, and deleting any system service.
Fully takes over commands to the Service Control Manager (start, stop, etc.). After the program being run terminates, it automatically reports status to the Service Control Manager and then exits itself, without staying resident in memory.
pause / continue operations.
One runassrv service can concurrently run multiple applications specified by /cmdline, and the applications are initialized in the specified order.
runassrv.exe itself does not need to be placed in the system search path.
Added the control operation, which sends a control code to the specified service.
Added the listsrv operation, which lists all services and drivers, and supports many filtering conditions.
Added the -logfile and -loglevel options, logging support.
Added -unstoppable; the Service Control Manager will refuse to stop a service installed with this option.
Memory trimming strategy; in typical cases memory usage is less than 300KB.
 

http://baiy.cn/utils/runassrv/index.htm

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 4 Posted 2009-02-24 21:44 ·  中国 北京 联通
中级用户
★★
Credits 313
Posts 162
Joined 2007-04-02 06:45
19-year member
UID 83693
Gender Male
Status Offline
I already know about Run As Service.

What I want is a way to replace a system service program using only system commands!
When searching online about installing the radmin server side, I found a method for replacing the server side, but it didn't succeed in actual operation.

With the situation above, did something go wrong somewhere?
Floor 5 Posted 2009-02-25 21:58 ·  中国 北京 联通
中级用户
★★
Credits 313
Posts 162
Joined 2007-04-02 06:45
19-year member
UID 83693
Gender Male
Status Offline
net stop clipsrv
sc delete clipsrv

move C:\WINDOWS\system32\clipsrv.exe c:\a.exe
copy c:\w.exe C:\WINDOWS\system32\clipsrv.exe

sc create clipsrv BinPath= "C:\WINDOWS\system32\clipsrv.exe /service" type= own type=
interact start= auto DisplayName= "ClipBook"
sc description clipsrv "Enables ClipBook Viewer to store information and share it with remote computers. If this service is stopped, ClipBook Viewer will not be able to share information with remote computers. If this service is disabled, any services that depend on it will fail to start."

sc config clipsrv start= auto
net start clipsrv

pause

Save it as w.bat, and when I run it, it appears as shown in the picture:

But if I copy it into CMD line by line, it runs normally. There must still be some problem somewhere, my eyes and brain are about to collapse!
Attachments
未命名.gif
Floor 6 Posted 2009-02-25 22:14 ·  中国 北京 联通
中级用户
★★
Credits 313
Posts 162
Joined 2007-04-02 06:45
19-year member
UID 83693
Gender Male
Status Offline
Struggled through the collapse and solved it!
Floor 7 Posted 2009-02-25 22:16 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Can the copy command on the fourth line really execute? What system are you using?
Floor 8 Posted 2009-02-25 22:18 ·  中国 北京 联通
中级用户
★★
Credits 313
Posts 162
Joined 2007-04-02 06:45
19-year member
UID 83693
Gender Male
Status Offline
The Deepin stripped-down edition in vmware, no system protection, hehe
Floor 9 Posted 2009-02-25 22:19 ·  中国 北京 联通
中级用户
★★
Credits 313
Posts 162
Joined 2007-04-02 06:45
19-year member
UID 83693
Gender Male
Status Offline
If there were system protection, using raplace should work, right
Floor 10 Posted 2009-02-25 22:19 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
It has nothing to do with system protection. copy doesn't support this kind of usage, does it?
Floor 11 Posted 2009-02-25 22:24 ·  中国 北京 联通
中级用户
★★
Credits 313
Posts 162
Joined 2007-04-02 06:45
19-year member
UID 83693
Gender Male
Status Offline
COPY?

[ Last edited by ooaf on 2009-2-25 at 22:25 ]
Attachments
未命名.gif
Floor 12 Posted 2009-02-25 22:26 ·  中国 北京 联通
中级用户
★★
Credits 313
Posts 162
Joined 2007-04-02 06:45
19-year member
UID 83693
Gender Male
Status Offline
Boss Hatzi! Please give me some guidance!
Floor 13 Posted 2009-02-25 22:40 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Sorry, I remembered the copy command wrong.

When using the net command in a BAT file, what should follow is the service's Display Name, not the Service Name. The correct way is:

net stop + Display Name
or
sc stop + Service Name
Floor 14 Posted 2009-02-25 22:52 ·  中国 北京 联通
中级用户
★★
Credits 313
Posts 162
Joined 2007-04-02 06:45
19-year member
UID 83693
Gender Male
Status Offline
See the picture for explanation:
Attachments
未命名.gif
Floor 15 Posted 2009-02-25 22:55 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
At the command line, net can be followed by either the service name or the display name; in a BAT file, it's as post #13 said.
Forum Jump: