找回密码
 加入
搜索
查看: 2202|回复: 3

组策略刷新问题..

[复制链接]
发表于 2009-8-19 16:10:10 | 显示全部楼层 |阅读模式
本帖最后由 chengjinn 于 2009-8-22 14:53 编辑

DllCall("user32.dll","int","SendMessageTimeout","hwnd",65535,"int",26,"int",0,"int",0,"int",0,"int",1000,"str","dwResult")
上面的命令可以刷新组策略..
但是我一但导入了这个组策略文件.就会失效.有没有高手知道为什么.?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2009-8-19 18:13:40 | 显示全部楼层
收藏好几种方法,都试试
1:最有效的: 结束explorer.exe
Do
   ProcessClose("explorer.exe")    
Until Not ProcessExists("explorer.exe")
;;2、调用SendMessageTimeout。效果不理想。
DllCall("user32.dll","int","SendMessageTimeout","hwnd",65535,"int",26,"int",0,"int",0,"int",0,"int",1000,"str","dwResult") 
;;3、调用组策略刷新设置工具,测试无效

Run("gpupdate /force",@SystemDir)

;;4、又一刷新注册表的API,非常强捍。效果不错
DllCall("shell32.dll", "none", "SHChangeNotify", "long", 0x8000000, "int", 0, "ptr", 0, "ptr", 0)
;;5、刷新桌面
Run ("RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters")
;6.另一种API
Global Const $RP_FORCE = 1
Global Const $True = 1
Global Const $False = 0
$bMachine = $True
Dim $Return
$Return = DllCAll("Userenv.dll","int","RefreshPolicyEx","int",$bMachine,"int",$RP_FORCE)
If IsArray($Return) Then
        If $Return[0] <> 0 Then 
                        MsgBox(0,"","操作成功.返回值:" & $Return[0])
                Else
                        MsgBox(0,"","操作失败.返回值:" & $Return[0])
                EndIf
EndIf
Exit
发表于 2009-8-19 18:15:59 | 显示全部楼层
测试有效果的发上来。
 楼主| 发表于 2009-8-21 08:15:30 | 显示全部楼层
;;4、又一刷新注册表的API,非常强捍。效果不错DllCall("shell32.dll", "none", "SHChangeNotify", "long", 0x8000000, "int", 0, "ptr", 0, "ptr", 0)
复制代码



刷新注册表没有效果

刷新桌面的...注册表更新桌面路径后.
刷新也没有用.``
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-17 18:58 , Processed in 0.079447 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表