bj17209 发表于 2010-7-3 12:39:17

IE60天记录转储器 ,遇到问题,不能生效!!

请教注册表生效问题!代码附上!
为什么修改了注册表不能生效啊!请哪位大哥帮忙看看啊!
60config.ini


服务器IP=192.168.0.252
映射磁盘=O:
映射路径=\\192.168.0.252\ie60$

au3代码

#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Icon=png-0094.ico
#AutoIt3Wrapper_Outfile=60tian.exe
#AutoIt3Wrapper_Res_Comment=60天记录保存器
#AutoIt3Wrapper_Res_Description=60天记录保存器
#AutoIt3Wrapper_Res_Fileversion=1.0.0.2
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=网络三毛QQ23371862
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <Process.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3> ;导入一个AU3自带文件,主要用其防止重复运行程序的函数
envupdate()

_Singleton("TheNameOfMy") ;这个函数就是用来检测是否有相同程序在运行如果有则退出,就是只运行一次
Break(0) ;禁止退出!
Send("{NUMLOCK on}")
TraySetState(4)
;日志路径

If FileExists(@ScriptDir & "\60config.ini") Then
Else
      TrayTip("提示消息", "ie60天记录保存配置文件丢失!", 1)
      Sleep(3000)
      Qexit()
EndIf

;$time = IniRead(@ScriptDir & "\客户端配置.ini", "延时设置", "延时", "")
;Sleep($time)

$server1_ip = IniRead(@ScriptDir & "\60config.ini", "config", "服务器IP", "")
$var = Ping($server1_ip, 10)
If $var Then; also possible: If @error = 0 Then ...
      ;MsgBox(0, "Status", "测试:" & $var)
      server1()
      Exit
Else
      TrayTip("提示消息", "ie60天记录保存服务器无法链接", 3)
      Sleep(3000)
      Exit
EndIf
Func server1()
      $I_server1 = @ScriptDir & "\60config.ini"
      $I_files = IniRead($I_server1, "config", "映射磁盘", "")
      $I_fadmin = IniRead($I_server1, "config", "映射路径", "")
      ;映射驱动器
      DriveMapAdd($I_files, $I_fadmin)
                ;60天
      RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Url History", "DaysToKeep", "REG_DWORD", "0x0000003c")

      ;60天记录路径修改
      RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Cookies", "REG_SZ", $I_files & " \%COMPUTERNAME%\Cookies")
      RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "History", "REG_SZ", $I_files & "\%COMPUTERNAME%\History")
      RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Cookies", "REG_SZ", $I_files & "\%COMPUTERNAME%\Cookies")
      RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "History", "REG_SZ", $I_files & "\%COMPUTERNAME%\History")
      DllCall("user32.dll", "int", "SendMessageTimeout", "hwnd", 65535, "int", 26, "int", 0, "int", 0, "int", 0, "int", 1000, "str", "dwResult")
      Run("RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters")
      Run(@ComSpec & " /c gpupdate /force", "", 0)

EndFunc   ;==>server1
Func Qexit()
      Exit
EndFunc   ;==>Qexit
Func Terminate()

      Exit 0
EndFunc   ;==>Terminate



还是不能生效,帮帮忙啊,怎么解决啊

xsjtxy 发表于 2010-7-3 17:16:58

RegWrite ( "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Cache", "REG_EXPAND_SZ", "\\192.168.1.240\IE临时文件")
ProcessClose ( "IEXPLORE.EXE" )

不知道你费那个神做什么。立即生效的。

xsjtxy 发表于 2010-7-3 17:35:35

$tmp = "\\192.168.1.240\IE临时文件"
If FileExists($tmp) Then
if FileOpen($tmp & "\测试.txt", 2) then
RegWrite ( "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Cache", "REG_EXPAND_SZ", "\\192.168.1.240\IE临时文件")
RegWrite ( "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Url History","DaysToKeep", "REG_DWORD", "999")
ProcessClose ( "IEXPLORE.EXE" )
msgbox(0,"","设置成功!")
else
RegWrite ( "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Cache", "REG_EXPAND_SZ", "%USERPROFILE%\Local Settings\Temporary Internet Files")
msgbox(0,"", $tmp & @CRLF & "目录无法写入,请检查权限!")
endif
Else
RegWrite ( "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Cache", "REG_EXPAND_SZ", "%USERPROFILE%\Local Settings\Temporary Internet Files")
    MsgBox(4096,"", $tmp & @CRLF & "目录无法访问。")
EndIf

xsjtxy 发表于 2010-7-3 17:46:56

每次开机运行。检查服务器路径是否存在,并可写入。如果不能写入。就设置成本地路径。防止路径不存在时打不开网页。
临时文件保存天数999天
不需要映射成磁盘。
修改后。结束IE进程。即时生效,不需要刷新注册表。

bj17209 发表于 2010-7-4 12:37:01

好的,我测试下啊!!谢谢了,各位
页: [1]
查看完整版本: IE60天记录转储器 ,遇到问题,不能生效!!