给sublime text3添加右键支持

哥最爱的sublime text3竟然没法设置右键打开文档,简直不开心啊~
多方搜索之后得到了几段大同小异的注册表代码,但是哥使用就是不成功,简直太不开心啦!!

幸运的是还是让哥找到一枚可以使用的解决办法:

只需要把下面的代码保存 txt 文本文件,后缀名改为 vbs ,放入到sublime的目录下运行就好。这个脚本添加了 右键打开文件,右键打开文件夹,右键弹出菜单也有了图标嵌入:

dim WshShell, sublime
set WshShell = WScript.CreateObject("WScript.Shell")
sublime      = WshShell.CurrentDirectory + "\sublime_text.exe"
icon         = sublime + ",0"
editFile     = sublime + " %1"
openDirctory = sublime + " -n " + """%1"""
WshShell.RegWrite "HKEY_CLASSES_ROOT\*\shell\Edit with Sblime Text\Icon", icon
WshShell.RegWrite "HKEY_CLASSES_ROOT\*\shell\Edit with Sblime Text\command\", editFile
WshShell.RegWrite "HKEY_CLASSES_ROOT\Directory\shell\Open with SubLime Text\Icon", icon
WshShell.RegWrite "HKEY_CLASSES_ROOT\Directory\shell\Open with SubLime Text\Command\", openDirctory
msgbox "OK"

下面是对应的删除注册表的文件,保存任意地方 txt 文本文件中,后缀名改为 reg 运行即可:

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text]

[-HKEY_CLASSES_ROOT\Directory\shell\Open with SubLime Text]

感谢原作者:
http://blog.csdn.net/thisinnocence/article/details/25335673

Share

小 虾

哦也,我是小虾

You may also like...

1 Response

  1. 消灭星星 says:

    这个必须支持啊~沙发,学习了,感谢分享。我觉得写的挺好的

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.