2012-10-27 73 views
4

如您所知,Windows 8昨天推出。我已经升级了,一切似乎都正常,但是当我为我的代码编辑器安装Sublime Text 2时,用于说“使用Sublime Text 2编辑”的上下文菜单中的按钮不再存在。我曾尝试使用自定义注册表脚本,并添加了按钮,但Windows 8 仍然问我想要打开它的程序。下面是我使用的脚本:Windows 8中的Sublime Text 2上下文菜单

(保存为add_context_menu.reg)

Windows Registry Editor Version 5.00 


[HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2] 

@="Open with S&ublime Text 2" 

[HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command] 

@="C:\Program Files\Sublime Text 2\sublime_text.exe \"%1\"" 

任何帮助吗?

回答

6

我正在使用Windows 8Sublime Text 2,我有与Open with Sublime Text 2按钮没有问题,其实我用它:)

Windows Registry Editor Version 5.00 

[HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2] 

[HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command] 
@="C:\\Program Files\\Sublime Text 2\\sublime_text.exe \"%1\"" 

我猜你没有逃脱你的反斜线可能是事实,打开该.reg问题

+1

注意,当您安装崇高文字和允许安装程序添加上下文菜单,它使用该命令比如Atom,VSCode另一个应用程序创建没有反斜杠的注册表项。也许这是安装程序中的错误? –

1

在Windows 8下面的代码为我工作

C:\Program Files\Sublime Text 2\sublime_text.exe "%1"

1

这是一个更好的命令。只需将它保存到应用程序目录中的bat文件并以管理员身份运行即可。

U可以...只需改变应用程序*线

@echo off 
SET AppKey=SublimeText3 
SET AppTitle=Open with Sublime Text 3 
SET AppPath=%~dp0sublime_text.exe 
SET AppIcon=%AppPath%,0 

REG ADD "HKEY_CLASSES_ROOT\*\shell\%AppKey%" /ve /f /d "%AppTitle%" 
REG ADD "HKEY_CLASSES_ROOT\*\shell\%AppKey%" /v "Icon" /f /d "%AppIcon%" 
REG ADD "HKEY_CLASSES_ROOT\*\shell\%AppKey%\command" /ve /f /d "%AppPath% \"%%1\"" 

REG ADD "HKEY_CLASSES_ROOT\Folder\shell\%AppKey%" /ve /f /d "%AppTitle%" 
REG ADD "HKEY_CLASSES_ROOT\Folder\shell\%AppKey%" /v "Icon" /f /d "%AppIcon%" 
REG ADD "HKEY_CLASSES_ROOT\Folder\shell\%AppKey%\command" /ve /f /d "%AppPath% \"%%v\"" 

REG ADD "HKEY_CLASSES_ROOT\Directory\Background\shell\%AppKey%" /ve /f /d "%AppTitle%" 
REG ADD "HKEY_CLASSES_ROOT\Directory\Background\shell\%AppKey%" /v "Icon" /f /d "%AppIcon%" 
REG ADD "HKEY_CLASSES_ROOT\Directory\Background\shell\%AppKey%\command" /ve /f /d "%AppPath% \"%%v\""