组策略刷新问题..
本帖最后由 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")
上面的命令可以刷新组策略..
但是我一但导入了这个组策略文件.就会失效.有没有高手知道为什么.? 收藏好几种方法,都试试
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.另一种APIGlobal 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 Then
MsgBox(0,"","操作成功.返回值:" & $Return)
Else
MsgBox(0,"","操作失败.返回值:" & $Return)
EndIf
EndIf
Exit 测试有效果的发上来。 ;;4、又一刷新注册表的API,非常强捍。效果不错DllCall("shell32.dll", "none", "SHChangeNotify", "long", 0x8000000, "int", 0, "ptr", 0, "ptr", 0)
复制代码
刷新注册表没有效果
刷新桌面的...注册表更新桌面路径后.
刷新也没有用.``
页:
[1]