找回密码
 加入
搜索
查看: 2155|回复: 1

[原创] 你的AUTOIT右键菜单自己做主

[复制链接]
发表于 2018-3-1 08:54:45 | 显示全部楼层 |阅读模式
如果想更好的,请下载大神的AU3版本切换工具,里面也有修改菜单的功能。请不要直接运行代码,请根据自己电脑的实际情况修改,本代码仅供参考。ACN版的右键菜单请大家自行查找注册表文件就可以了。
;仅供参考,如有不对请纠正
;以下是旧版的右键菜单代码
Global Const $hklm_autoit = "HKLM\SOFTWARE\AutoIt v3"
Global Const $hklm64_autoit = "HKLM64\SOFTWARE\AutoIt v3"
Global Const $hkcu_autoit = "HKCU\SOFTWARE\AutoIt v3\AutoIt"
Global Const $hklmcv = "HKLM\Software\Microsoft\Windows\CurrentVersion"
Global Const $hkcr_au3shell = "HKCR\AutoIt3Script\Shell"
Global Const $hkcr_a3xshell = "HKCR\AutoIt3XScript\Shell"
Global Const $hkcr_au3shellex = "HKCR\AutoIt3Script\ShellEx"
Global Const $hkcr_a3xshellex = "HKCR\AutoIt3XScript\ShellEx"
Global Const $templatea = @ScriptDir & "\SciTE\默认模板.au3"

Func deloldreg()
        RegDelete("HKCU\SOFTWARE\AutoIt v3\AutoIt")
        RegDelete($hklm_autoit)
        RegDelete($hklm64_autoit)
        RegDelete("HKCR\.au3")
        RegDelete("HKCR\.a3x")
        RegDelete("HKCR\AutoIt3Script")
EndFunc   ;==>删除之前的右键菜单和安装目录路径

Func addau3reg()
        RegWrite("HKCR\AutoIt3Script", "", "REG_SZ", "AutoIt v3 脚本")
        RegWrite("HKCR\AutoIt3Script\DefaultIcon", "", "REG_SZ", @ScriptDir & "\Aut2Exe\Icons\filetype1.ico")
        RegWrite("HKCU\SOFTWARE\AutoIt v3\AutoIt", "Include", "REG_SZ", @ScriptDir & "\UserInclude")
        RegWrite($hkcr_au3shell, "", "REG_SZ", "0penX86")
        RegWrite($hkcr_au3shell & "\Compile", "", "REG_SZ", "编译脚本(带进度)")
        RegWrite($hkcr_au3shell & "\Compile\Command", "", "REG_SZ", '"' & @ScriptDir & '\SciTE\ACNWrapper\ACNWrapper.exe" /in "%l"')
        RegWrite($hkcr_au3shell & "\CGUICompile", "", "REG_SZ", "编译脚本(带选项)")
        RegWrite($hkcr_au3shell & "\CGUICompile\Command", "", "REG_SZ", '"' & @ScriptDir & '\SciTE\ACNWrapper\ACNWrapper.exe" /showgui /in "%l"')
        RegWrite($hkcr_au3shell & "\open", "", "REG_SZ", "编辑脚本(SCITE)")
        Local $scite = @ScriptDir & "\Aut2Exe\Icons\scite.ico"
        RegWrite($hkcr_au3shell & "\0penX86", "Icon", "REG_SZ", $scite);给右键选项加上自己喜欢的图标,么么哒。如果不需要请自行注释
        RegWrite($hkcr_au3shell & "\open\Command", "", "REG_SZ", '"' & @ScriptDir & '\SciTE\SciTE.exe" "%1"')
        RegWrite("HKCR\.au3\ShellNew", "FileName", "REG_SZ", $templatea)
        If @OSArch <> "X86" Then
                RegWrite($hkcr_au3shell & "\0penX64", "", "REG_SZ", "运行脚本(X64)")
                RegWrite($hkcr_au3shell & "\0penX64\Command", "", "REG_SZ", @ScriptDir & '\AutoIt3_x64.exe "%1" %*')
                RegWrite($hkcr_au3shell & "\0penX86", "", "REG_SZ", "运行脚本(X86)")
                RegWrite($hkcr_au3shell & "\0penX86\Command", "", "REG_SZ", @ScriptDir & '\AutoIt3.exe "%1" %*')
                RegWrite($hkcr_au3shell, "", "REG_SZ", "0penX64")
        Else
                RegWrite($hkcr_au3shell & "\0penX86", "", "REG_SZ", "运行脚本")
                RegWrite($hkcr_au3shell & "\0penX86\Command", "", "REG_SZ", @ScriptDir & '\AutoIt3.exe "%1" %*')
        EndIf
        RegWrite($hkcr_au3shellex & "\DropHandler", "", "REG_SZ", "{86C86720-42A0-1069-A2E8-08002B30309D}")
EndFunc

Func adda3xreg()
        RegWrite($hkcr_a3xshell & "\Run", "", "REG_SZ", "运行脚本")
        RegWrite($hkcr_a3xshell & "\Run\Command", "", "REG_SZ", @ScriptDir & '\AutoIt3.exe "%1" %*')
        RegWrite("HKCR\AutoIt3XScript\DefaultIcon", "", "REG_SZ", @ScriptDir & "\Aut2Exe\Icons\TLB.ico")
        RegWrite($hkcr_a3xshellex & "\DropHandler", "", "REG_SZ", "{86C86720-42A0-1069-A2E8-08002B30309D}")
EndFunc

Func addscitereg()
        RegWrite($hklmcv & "\App Paths\SciTE.exe", "", "REG_SZ", @ScriptDir & "\SciTE\SciTE.exe")
        RegWrite($hklmcv & "\App Paths\SciTE.exe", "PATH", "REG_SZ", @ScriptDir & "\SciTE")
EndFunc

Func refreshicon()
        DllCall("shell32.dll", "none", "SHChangeNotify", "long", 134217728, "uint", BitOR(0, 4096), "ptr", 0, "ptr", 0)
        Return 1
EndFunc  ;==>刷新桌面
发表于 2018-3-5 09:39:15 | 显示全部楼层
这个阔以有,谢谢分享。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-23 17:56 , Processed in 0.070305 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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