Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Autohotkey 在windows 10中使用自动热键修改注册表值_Autohotkey - Fatal编程技术网

Autohotkey 在windows 10中使用自动热键修改注册表值

Autohotkey 在windows 10中使用自动热键修改注册表值,autohotkey,Autohotkey,当我按下Win+I时,我有以下脚本设置来更改环境变量(Mirus\u Active\u Directory)。它在Windows7中运行良好,但在Windows10中似乎不起作用 如何修改代码以使其与Windows 10一起工作 谢谢 SetTitleMatchMode RegEx return #IfWinActive ahk_class ExploreWClass #i:: SetPath() return #IfWinActive ahk_class Cabine

当我按下Win+I时,我有以下脚本设置来更改环境变量(Mirus\u Active\u Directory)。它在Windows7中运行良好,但在Windows10中似乎不起作用

如何修改代码以使其与Windows 10一起工作

谢谢

SetTitleMatchMode RegEx
return

#IfWinActive ahk_class ExploreWClass
    #i::
    SetPath()
    return
#IfWinActive ahk_class CabinetWClass
    #i::
        SetPath()
    return
#IfWinActive


; Opens the command shell 'cmd' in the directory browsed in Explorer.
; Note: expecting to be run when the active window is Explorer.
;
SetPath()
{
    ; This is required to get the full path of the file from the address bar
    WinGetText, full_path, A

    ; Split on newline (`n)
    StringSplit, word_array, full_path, `n
    ; Take the first element from the array
    full_path = %word_array1%   

    ; strip to bare address
    full_path := RegExReplace(full_path, "^Address: ", "")

    ; Just in case - remove all carriage returns (`r)
    StringReplace, full_path, full_path, `r, , all


    IfInString full_path, \
    {
        RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SYSTEM\CurrentControlSet\Control\Session Manager\Environment, Mirus_Active_Directory, %full_path%\
        RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, SYSTEM\ControlSet001\Control\Session Manager\Environment, Mirus_Active_Directory, %full_path%\
    EnvUpdate
    }
}

尝试。我已将AutoHotKey设置为以管理员身份运行,但没有帮助。