中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 08:59
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » [Original] System service optimization batch processing, a New Year gift for everyone!
Printable Version  4,593 / 17
Floor1 qasa Posted 2007-02-12 06:51
高级用户 Posts 311 Credits 959 From 广东-LianJiang
I have a friend who is very lazy. The day before yesterday, he asked me to make a batch script for optimizing Windows 2003 system services. So I take it as a New Year gift for everyone. Please forgive me.
I wonder if there is a return gift? Hehe. Adding points is like a red envelope!


Service Optimization.bat


Server.ini


Upload another configuration file for Windows XP with comments.

[ Last edited by qasa on 2007-2-14 at 02:59 PM ]

Attachments
服务优化.rar (1.82 KiB)
ServerXP.rar (3.3 KiB)
Floor2 vkill Posted 2007-02-12 07:14
金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽
Just one line: sc config
Floor3 qasa Posted 2007-02-12 12:07
高级用户 Posts 311 Credits 959 From 广东-LianJiang
Originally posted by vkill at 2007-2-12 07:14:
Just one sentence: sc config


Well, yes, I think it's just using sc config. It's simple and easy to use, isn't it better? Why must it be complicated? Setting services this way is more convenient than setting them manually each time, isn't it?

So don't underestimate a single sc config; it's practical enough
Floor4 ksuday Posted 2007-02-12 23:27
初级用户 Posts 19 Credits 38
sc config. Learned, thanks
Floor5 zh159 Posted 2007-02-13 01:23
金牌会员 Posts 1,467 Credits 3,687
Simplify directly:

AeLookupSvc|1
Alerter|3
ALG|3
AppMgmt|2

to

AeLookupSvc|auto
Alerter|disabled
ALG|disabled
AppMgmt|demand

Modify:

for /f "tokens=1,2 delims=|" %%i in (server.ini) do (
if %%j equ 3 sc config %%i start= disabled >nul 2>nul
if %%j equ 2 sc config %%i start= demand >nul 2>nul
if %%j equ 1 sc config %%i start= auto >nul 2>nul
)

to:

for /f "tokens=1,2 delims=|" %%i in (server.ini) do (
sc config %%i start= %%j >nul 2>nul
)

This makes the content of server.ini more intuitive
Floor6 qasa Posted 2007-02-13 02:26
高级用户 Posts 311 Credits 959 From 广东-LianJiang

Re: zh159

I initially also prepared to write directly with letters as you did, but later due to the ease of understanding and operational issues, I still found numbers simpler. When making changes, there's no need to remember letters, and I was afraid that letters might be more error-prone than numbers. Hehe, this might also be a personal view, and it's still to be proven in practice.
So I emphasized the help aspect in the statement to let users understand the operation.


[ Last edited by qasa on 2007-2-13 at 02:31 AM ]
Floor7 qasa Posted 2007-02-15 13:07
高级用户 Posts 311 Credits 959 From 广东-LianJiang
Now an optimized service (Server.ini) for WinXP has been sorted out for your reference, with comments.
Floor8 lovehack2006 Posted 2007-02-15 13:48
初级用户 Posts 64 Credits 135
The article is very good, thank you!! Collected!!!
Floor9 xiejiqq Posted 2007-03-05 03:23
新手上路 Posts 6 Credits 9 From uiui
BAT is a good thing!!!!!!!!!!!!!!!
Floor10 mqi Posted 2007-03-06 06:11
初级用户 Posts 11 Credits 28
Why didn't the service change after I ran it?

My Server.ini is as follows:
Adobe LM Service|2
Alerter|3
Application Layer Gateway Service|3
Application Management|2
Automatic Updates|1
Background Intelligent Transfer Service|2
ClipBook|3
COM+ Event System|2
COM+ System Application|2
Computer Browser|2
Cryptographic Services|2
DCOM Server Process Launcher|1
DHCP Client|1
Distributed Link Tracking Client|2
Distributed Transaction Coordinator|2
DNS Client|2
Error Reporting Service|3
Event Log|1
Fast User Switching Compatibility|2
Help and Support|2
HID Input Service|1
HTTP SSL|2

Solved, thank you

[ Last edited by mqi on 2007-3-7 at 02:55 AM ]
Floor11 leoson88 Posted 2007-03-07 01:11
初级用户 Posts 39 Credits 83
I think it's better to just use SC config directly, no need to be so troublesome
Floor12 icehui Posted 2007-03-07 09:20
初级用户 Posts 12 Credits 25
Thanks! Learning!
Floor13 yrh Posted 2007-03-08 13:00
新手上路 Posts 4 Credits 8
Thank you! Learned it!
Floor14 nforce1 Posted 2007-03-09 10:08
初级用户 Posts 16 Credits 128
Collected~~ Thanks!
Floor15 anlan5 Posted 2007-03-09 21:47
新手上路 Posts 8 Credits 18
Learned something, thanks
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023