转载自百度知道,仅供个人学习之用。
以下是设置范例,以XPSp2为蓝本,可比对所用的系统进行增删和修改。注:未加入XPSP2的自动更新、安全中心、防火墙。
sc config Alerter start= demand
sc config TrkWks start= demand
sc config helpsvc start= demand
sc config PolicyAgent start= demand
sc config dmserver start= demand
sc config WmdmPmSn start= demand
sc config Spooler start= demand
sc config RemoteRegistry start= demand
sc config NtmsSvc start= demand
sc config seclogon start= demand
sc config Schedule start= demand
sc config WebClient start= demand
sc config W32Time start= demand
sc config WZCSVC start= demand
sc config ERSvc start= demand
sc config Themes start= demand
sc config FastUserSwitchingCompatibility start= disabled
sc config Messenger start= disabled
sc config ProtectedStorage start= disabled
sc config SSDPSRV start= disabled
sc config TermService start= disabled
sc config ShellHWDetection start= disabled
如果需要立即关闭服务也可把以下代码跟在上面的代码之后
sc stop W32Time
sc stop ShellHWDetection
sc stop TrkWks
sc stop helpsvc
sc stop dmserver
sc stop PolicyAgent
sc stop Spooler
sc stop RemoteRegistry
sc stop seclogon
sc stop Schedule
sc stop WZCSVC
sc stop ERSvc
sc stop Themes
sc stop FastUserSwitchingCompatibility
sc stop ProtectedStorage
sc stop SSDPSRV
sc stop WebClient
最后把修改好之后的代码存为services.cmd,在以后进行服务设置时,直接运行事先保存好的批处理文件就可以做到事半功倍了。