|
请教注册表生效问题!代码附上!
为什么修改了注册表不能生效啊!请哪位大哥帮忙看看啊!
60config.ini
[config]
服务器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自带文件,主要用其防止重复运行程序的函数
_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 |
|