|
发表于 2008-10-5 14:37:29
|
显示全部楼层
#include <WindowsConstants.au3>
Local $CCS = "HKLM\SYSTEM\CurrentControlSet\"
AutoSetServ()
Func AutoSetServ()
For $i In _ArrayCreate("Alerter", "ALG", "BITS", "Browser", "CiSvc", "ClipSrv", "COMSysApp", "dmadmin", "dmserver", "Dnscache", "ERSvc", "EventSystem", "helpsvc", "HidServ", "ImapiService", "lanmanserver")
If ServiceExists(@ComputerName, $i) = 1 Then
ServiceStop(@ComputerName, $i)
RegWrite($CCS & "\Services\" & $i, "start", "REG_DWORD", "4")
EndIf
Next
For $i In _ArrayCreate("Messenger", "mnmsrvc", "MSDTC", "NetDDE", "NetDDEdsdm", "Netlogon", "NtLmSsp", "Nvsvc", "Ose", "RDSessMgr", "RemoteAccess", "RemoteRegistry", "SCardSvr", "Schedule", "seclogon", "SENS", "SharedAccess")
If ServiceExists(@ComputerName, $i) = 1 Then
ServiceStop(@ComputerName, $i)
RegWrite($CCS & "\Services\" & $i, "start", "REG_DWORD", "4")
EndIf
Next
For $i In _ArrayCreate("Stisvc", "Swprv", "SysmonLog", "TermService", "TlntSvr", "TrkWks", "UMWdf", "upnphost", "UPS", "VSS", "W32Time", "WebClient", "WmdmPmSN", "WmiApSrv", "wuauserv", "WMConnectCDS", "WMPNetworkSvc", "WZCSVC")
If ServiceExists(@ComputerName, $i) = 1 Then
ServiceStop(@ComputerName, $i)
RegWrite($CCS & "\Services\" & $i, "start", "REG_DWORD", "4")
EndIf
Next
For $i In _ArrayCreate("LmHosts", "SSDPSRV", "Wmi", "RpcLocator", "winmgmt", "Spooler", "FastUserSwitchingCompatibility", "lanmanworkstation", "ShellHWDetection", "srservice", "wscsvc", "xmlprov")
If ServiceExists(@ComputerName, $i) = 1 Then
ServiceStop(@ComputerName, $i)
RegWrite($CCS & "\Services\" & $i, "start", "REG_DWORD", "4")
EndIf
Next
For $i In _ArrayCreate("AppMgmt", "CryptSvc", "HTTPFilter", "MSIServer", "NtmsSvc", "RasAuto", "RasMan")
If ServiceExists(@ComputerName, $i) = 1 Then
ServiceStop(@ComputerName, $i)
RegWrite($CCS & "\Services\" & $i, "start", "REG_DWORD", "3")
EndIf
Next
For $i In _ArrayCreate("AudioSrv", "Eventlog", "Netman", "Nla", "PlugPlay", "PolicyAgent", "ProtectedStorage", "RpcSs", "SamSs", "TapiSrv", "Themes", "DcomLaunch", "Dhcp")
If ServiceExists(@ComputerName, $i) = 1 Then
ServiceStart(@ComputerName, $i)
RegWrite($CCS & "\Services\" & $i, "start", "REG_DWORD", "2")
EndIf
Next
EnvUpdate()
MsgBox(0, "完成", "服务设置完成!")
EndFunc ;==>AutoSetServ
[ 本帖最后由 netegg 于 2008-10-5 14:43 编辑 ] |
|