本帖最后由 Nonenever 于 2009-8-20 20:01 编辑
下面的代码,重启 ,注消,或 系统属性-》高级-》环境变量-》Path 确定一下就可以起作用
不知道有没有其他办法,不注消就有效$PlusPath=@ScriptDir
$SYSEnvironmentPATH = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path')
If StringRight($SYSEnvironmentPATH, 1) <> ';' Then
$SYSEnvironmentPATH = $SYSEnvironmentPATH & ';'
EndIf
If StringInStr($SYSEnvironmentPATH, $PlusPath) == 0 Then
$SYSEnvironmentPATH=$SYSEnvironmentPATH & $PlusPath
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', 'REG_EXPAND_SZ', $SYSEnvironmentPATH)
EndIf
以下方法均无效Run("gpupdate /force", "", @SW_HIDE)
#include <ACN_MISC.au3>
_Refreshicon()
DllCall("user32.dll","int","SendMessageTimeout","hwnd",65535,"int",26,"int",0,"int",0,"int",0,"int",1000,"str","dwResult")
Do
ProcessClose("explorer.exe")
Until Not ProcessExists("explorer.exe")
Run("gpupdate /force","",@SW_HIDE)
下面的方法有效 |