直奔主题,效果如下:


鼠标右击文件或者文件夹,可直接用VSCode打开,非常方便。如果我们安装VSCode的时候没有选择这2个选项,那就享受不到这个便捷的功能了,那么怎么办呢?
有2种方法:
1.重装软件
在装的过程中勾选上这2个选项即可(肯定我们不愿意,很多配置 插件都用习惯了,再装很费事,即使是setting sync也免不了麻烦,所以这个我们不推荐)

2.修改注册表
右键打开文件
1, Win+R
打开运行,输入regedit
,打开注册表
,找到HKEY_CLASSES_ROOT\*\shell
分支,如果没有shell分支,则在*下点击右键,选择“新建
-项
”,建立shell分支。
2, 在shell下新建“VisualCode
”项,在右侧窗口的“默认”双击,在数据里输入“用VSCode打开
”。这是右键上显示的文字,可以随便写,只是为了方便查看
3, 在“VisualCode
”下再新建Command
项,在右侧窗口的“默认”键值栏内输入程序所在的安装路径,我的是:"D:\anzhuang\Microsoft VS Code\Code.exe" "%1"
。其中的%1表示要打开的文件参数。
4, 配置缩略图。在VisualCode
项上新建可扩充字符串值
,命名为Icon
,双击,把"D:\anzhuang\Microsoft VS Code\Code.exe"
放进数据就可以了。
5, 关闭注册表,即可生效。


右键打开文件夹
1, Win+R
打开运行,输入regedit
,打开注册表
,找到HKEY_CLASSES_ROOT\Directory\shell
分支
2, 同上面的2一样,数据内的值为“用VSCode打开文件夹
”
3、4、5、步骤完全一样,不再重复说明了。


右键文件夹空白处,打开文件夹
-
Win+R
打开运行,输入regedit
,打开注册表
,找到HKEY_CLASSES_ROOT\Directory\Background\shell\
分支
2、同上面的2完全一样
3、同上,把 %1
改为%V
,例如:"D:\anzhuang\Microsoft VS Code\Code.exe" "%V"
4、5同上,完全一样


最终效果如下:

注意安装路径是否正确,不要直接复制我的。直接右击vscode的桌面快捷方式,看属性,即可快速复制到他的路径。如下图

网友评论