• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
徐爱
博客园    首页    新随笔    联系   管理    订阅  订阅
添加 Open with VSCode到右键菜单

想要如下效果:

在文件上直接右键,可以选择Open with VSCode即用VSCode打开。

 

 

 

 

 

1、在桌面新建一个后缀为xxx.reg的文件:

 

 

2、用记事本打开,然后把下面文字拷贝进去:

Windows Registry Editor Version 5.00

	[HKEY_CLASSES_ROOT\*\shell\VSCode]
	@="Open with VSCode"
	"Icon"="D:\\Software\\Microsoft VS Code\\Code.exe"
	
	[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
	@="\"D:\\Software\\Microsoft VS Code\\Code.exe\" \"%1\""
	
	Windows Registry Editor Version 5.00
	
	[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
	@="Open with VSCode"
	"Icon"="D:\\Software\\Microsoft VS Code\\Code.exe"
	
	[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
	@="\"D:\\Software\\Microsoft VS Code\\Code.exe\" \"%V\""
	
	Windows Registry Editor Version 5.00
	
	[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
	@="Open with VSCode"
	"Icon"="D:\\Software\\Microsoft VS Code\\Code.exe"
	
	[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
	@="\"D:\\Software\\Microsoft VS Code\\Code.exe\" \"%V\""

注意:
以上所有的   D:\Software\Microsoft VS Code\Code.exe   要改成自己vscode的安装路径。

 

3、然后保存文件,双击直接运行,此时右键菜单多出一个 open with VSCode。

 

4、大功告成~

posted on 2021-05-21 18:27  徐爱  阅读(338)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3