分离杀软提高启动速度 *
2008-01-19 10:14:57
系统中安装瑞星和360卫士后,启动速度大降
有什么办法提高一点速度,开机时有许多启动程序,杀软先驻留后会扫描这些文件会降低启动速度,如果把杀软放入最后启动感觉应该快些,我们一般都写了些小工具使用,可以嵌入代码在系统闲置时候加载杀软。
首先看杀软的组成
注册表开机运行项目
[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run]
"RfwMain"="/"d://Program Files//Rising//Rfw//rfwmain.exe/" -Startup"
"RavTask"="/"d://Program Files//Rising//Rav//RavTask.exe/" -system"
"360Safetray"="D://Program Files//360SAFE//safemon//360Tray.exe /start"
系统服务4兄弟
1.Rising Personal Firewall Service
2.Rising Process Communication Center '驱动保护,无法停止
3.Rising Proxy Service
4.Rising RealTime Monitor '驱动保护
原理清楚了,当然开工了,你应该理解了Windows scrīpt Host Object Model的相关属性。
'frm
没启动杀软内存剩余113,运行后82M,环境xpsp2+256 SDRAM+c3 1433M CPU
分离后看到杀软很费加载时间的。
有什么办法提高一点速度,开机时有许多启动程序,杀软先驻留后会扫描这些文件会降低启动速度,如果把杀软放入最后启动感觉应该快些,我们一般都写了些小工具使用,可以嵌入代码在系统闲置时候加载杀软。
首先看杀软的组成
注册表开机运行项目
[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run]
"RfwMain"="/"d://Program Files//Rising//Rfw//rfwmain.exe/" -Startup"
"RavTask"="/"d://Program Files//Rising//Rav//RavTask.exe/" -system"
"360Safetray"="D://Program Files//360SAFE//safemon//360Tray.exe /start"
系统服务4兄弟
1.Rising Personal Firewall Service
2.Rising Process Communication Center '驱动保护,无法停止
3.Rising Proxy Service
4.Rising RealTime Monitor '驱动保护
原理清楚了,当然开工了,你应该理解了Windows scrīpt Host Object Model的相关属性。
'frm
CODE:
Option Explicit
Private Sub cmdRemoveItem_Click()
Dim lngResult As Long
Call RemoveStart
lngResult = MsgBox("是否重启电脑?", vbQuestion + vbYesNo, "询问")
If lngResult = vbYes Then
Call Shell("shutdown -r -f -t 2", vbHide)
End If
End Sub
Private Sub cmdStartProc_Click()
Call StartProc
MsgBox "全部项目启动完毕!", vbInformation, "完成"
End Sub
'mod_DisposeProc
CODE:
Option Explicit
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Private Const MAX_PATH = 260
Public Sub RemoveStart()
Dim objWscrīpt As Object '动态引用Windows scrīpt Host Object Model
Set ōbjWscrīpt = CreateObject("wscrīpt.shell")
On Error Resume Next
Call objWscrīpt.RegDelete("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run/360Safetray")
Call objWscrīpt.RegDelete("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run/RavTask") '瑞星杀毒软件相关程序。
Call objWscrīpt.RegDelete("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run/RfwMain") '瑞星防火墙主程序。
'demand设置服务为手动启动
Call objWscrīpt.Run("sc config RfwService start= demand", vbHide) '瑞星防火墙服务
Call objWscrīpt.Run("sc config RsCCenter start= demand", vbHide) '瑞星杀毒软件信息中心程序,驱动保护,无法停止
Call objWscrīpt.Run("sc config RfwProxySrv start= demand", vbHide) '瑞星个人防火墙家长保护程序。
Call objWscrīpt.Run("sc config RsravMon start= demand", vbHide) '瑞星杀毒软件实时监控程序,驱动保护,无法停止
Set ōbjWscrīpt = Nothing
End Sub
Public Sub StartProc()
Dim strRunPath As String
Dim strRavPath As String
Dim strRfwPath As String
Dim objWscrīpt As Object '动态引用Windows scrīpt Host Object Model
On Error Resume Next
Set ōbjWscrīpt = CreateObject("wscrīpt.shell")
'排队启动服务
Call objWscrīpt.Run("net start RfwService", vbHide, True) '瑞星防火墙服务
Call objWscrīpt.Run("net start RsCCenter", vbHide, True) '瑞星杀毒软件信息中心程序,驱动保护,无法停止
Call objWscrīpt.Run("net start RfwProxySrv", vbHide, True) '瑞星个人防火墙家长保护程序。
Call objWscrīpt.Run("net start RsravMon", vbHide, True) '瑞星杀毒软件实时监控程序,驱动保护,无法停止
strRunPath = objWscrīpt.RegRead("HKEY_LOCAL_MACHINE/SOFTWARE/rising/Rfw/installpath")
strRunPath = ShortName(strRunPath) & "rfwmain.exe /Startup"
Call objWscrīpt.Run(strRunPath, vbHide) '注意瑞星防火墙程序是一直运行的,你不能等它退出,参数选择False
strRunPath = objWscrīpt.RegRead("HKEY_LOCAL_MACHINE/SOFTWARE/rising/Rav/installpath")
strRunPath = ShortName(strRunPath) & "/RavTask.exe -System"
Call objWscrīpt.Run(strRunPath, vbHide)
strRunPath = "D:/Program Files/360SAFE/safemon/" '这里无法获取360卫士路径,我用的是绿色版,就不深究了,办法当然有。
strRunPath = ShortName(strRunPath) & "360Tray.exe /start"
Call objWscrīpt.Run(strRunPath, vbHide) '注意360程序是一直运行的,你不能等它退出
Set ōbjWscrīpt = Nothing
End Sub
Public Function ShortName(lpszLongPath As String) As String
Dim lRet As Long
Dim lpszShortPath As String
Dim lchr0pos As Long
lpszShortPath = Space$(MAX_PATH)
lRet = GetShortPathName(lpszLongPath, lpszShortPath, MAX_PATH)
lchr0pos = InStr(lpszShortPath, Chr$(0))
ShortName = Left$(lpszShortPath, lchr0pos - 1)
End Function
可以看到,Windows scrīpt Host Object Model就是VB中的MFC,其是VC++库,根本无须担心代码速度。
没启动杀软内存剩余113,运行后82M,环境xpsp2+256 SDRAM+c3 1433M CPU
分离后看到杀软很费加载时间的。