nmgwddj 发表于 2010-1-7 15:32:08

递归等级超出限制 为了避免溢出而退出

#Region AutoIt3Wrapper 预编译参数(常用参数)
#AutoIt3Wrapper_Res_Comment=专制各种抢IE主页的
#AutoIt3Wrapper_Res_Description=专制各种抢IE主页的
#AutoIt3Wrapper_Res_Fileversion=1.0.0.3
#EndRegion AutoIt3Wrapper 预编译参数(常用参数)
#cs ____________________________________
        脚本作者: DJ
        Email: nmgwddj@qq.com
        QQ/TM: 499084289
        脚本版本: 1.0.0.3
        脚本功能: 锁定您的IE主页
       
#ce _______________脚本开始_________________
Dim $b
$b = IniRead(@ScriptDir & "\reg.ini", "配置", "iexplorer", 0)
FileInstall("regini.exe", @WindowsDir & "\regini.exe", 1)
FileInstall("reg.txt", @WindowsDir & "\reg.txt", 1)
FileInstall("everyone.txt", @WindowsDir & "\everyone.txt", 1)
Sleep(1000)
RunWait(@ComSpec & ' /c regini.exe c:\windows\everyone.txt', "", @SW_HIDE)
RunWait(@ComSpec & ' /c reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{00000000-0000-0000-0000-000000000099} /f>nul', "", @SW_HIDE)
start()
Func start()
        $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace", 1)
        If $var = "{00000000-0000-0000-0000-000000000099}" Then
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}", "", "REG_SZ", "InternetExplorer")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}", "", "REG_EXPAND_SZ", "")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}", "InfoTip", "REG_EXPAND_SZ", "@shdoclc.dll,-881")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}", "LocalizedString", "REG_EXPAND_SZ", "@shdoclc.dll,-880")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}\DefaultIcon", "", "REG_EXPAND_SZ", "shdoclc.dll,-190")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}\shell", "", "REG_SZ", "OpenHomePage")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}\shell\OpenHomePage", "", "REG_SZ", "打开主页(&H)")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}\shell\OpenHomePage", "MUIVerb", "REG_SZ", "@shdoclc.dll,-10241")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}\shell\OpenHomePage\Command", "", "REG_SZ", $b)
                DllCall("shell32.dll", "none", "SHChangeNotify", "long", 0x8000000, "int", 0, "ptr", 0, "ptr", 0)
                Run(@ComSpec & ' /c regini.exe c:\windows\reg.txt', "", @SW_HIDE)
                quiet()
        Else
                start()
        EndIf
EndFunc   ;==>start
Func quiet()
        FileDelete("c:\windows\everyone.txt")
        FileDelete("c:\windows\reg.txt")
        Exit
EndFunc   ;==>quiet

nmgwddj 发表于 2010-1-7 15:35:00

首先我是删除HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{00000000-0000-0000-0000-000000000099
这个项

然后执行判断 判断是否存在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{00000000-0000-0000-0000-000000000099
如果存在 那么删除 创建新的IE
如果没有 从新执行判断

可能是判断出问题了 麻烦高手给看看

298311657 发表于 2010-1-7 16:30:11

AU3递归最大支持5100级,你的代码显然会超过这个限制

298311657 发表于 2010-1-7 16:33:32

#Region AutoIt3Wrapper 预编译参数(常用参数)
#AutoIt3Wrapper_Res_Comment=专制各种抢IE主页的
#AutoIt3Wrapper_Res_Description=专制各种抢IE主页的
#AutoIt3Wrapper_Res_Fileversion=1.0.0.3
#EndRegion AutoIt3Wrapper 预编译参数(常用参数)
#cs ____________________________________
      脚本作者: DJ
      Email: nmgwddj@qq.com
      QQ/TM: 499084289
      脚本版本: 1.0.0.3
      脚本功能: 锁定您的IE主页
      
#ce _______________脚本开始_________________
Dim $b,$a=0
$b = IniRead(@ScriptDir & "\reg.ini", "配置", "iexplorer", 0)
FileInstall("regini.exe", @WindowsDir & "\regini.exe", 1)
FileInstall("reg.txt", @WindowsDir & "\reg.txt", 1)
FileInstall("everyone.txt", @WindowsDir & "\everyone.txt", 1)
Sleep(1000)
RunWait(@ComSpec & ' /c regini.exe c:\windows\everyone.txt', "", @SW_HIDE)
RunWait(@ComSpec & ' /c reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{00000000-0000-0000-0000-000000000099} /f>nul', "", @SW_HIDE)

While 1
        start()
WEnd

Func start()
                $a += 1
      $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace", 1)
      If $var = "{00000000-0000-0000-0000-000000000099}" Then
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}", "", "REG_SZ", "InternetExplorer")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}", "", "REG_EXPAND_SZ", "")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}", "InfoTip", "REG_EXPAND_SZ", "@shdoclc.dll,-881")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}", "LocalizedString", "REG_EXPAND_SZ", "@shdoclc.dll,-880")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}\DefaultIcon", "", "REG_EXPAND_SZ", "shdoclc.dll,-190")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}\shell", "", "REG_SZ", "OpenHomePage")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}\shell\OpenHomePage", "", "REG_SZ", "打开主页(&H)")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}\shell\OpenHomePage", "MUIVerb", "REG_SZ", "@shdoclc.dll,-10241")
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{B416D21B-3B22-B6D4-BBD3-BBD452DB3D5B}\shell\OpenHomePage\Command", "", "REG_SZ", $b)
                DllCall("shell32.dll", "none", "SHChangeNotify", "long", 0x8000000, "int", 0, "ptr", 0, "ptr", 0)
                Run(@ComSpec & ' /c regini.exe c:\windows\reg.txt', "", @SW_HIDE)
                quiet()
      Else
                If $a < 5100 Then start()
      EndIf
EndFunc   ;==>start
Func quiet()
      FileDelete("c:\windows\everyone.txt")
      FileDelete("c:\windows\reg.txt")
      Exit
EndFunc   ;==>quiet这样应该可以,我没测试,不过你可以试试
页: [1]
查看完整版本: 递归等级超出限制 为了避免溢出而退出