window 右键菜单添加 vscode

本文详细介绍如何通过修改注册表,使Visual Studio Code出现在文件和文件夹的右键菜单中,便于快速编辑和打开项目。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. 新建一个名为 1.reg 的文件,找一个记事本或者sublime打开,名称无所谓,但是一定需要带上 .reg 后缀。
  2. 查看你自己的电脑的vscode安装目录,最简单的方法就是右键桌面的vscode,查看属性就知道了。以我的安装地址为例:D:\Program Files\Microsoft VS Code\Code.exe , 单反斜杠最好都换成双反斜杠。
  3. 复制一下内容到 1.reg 文件中。
Windows Registry Editor Version 5.00 
 
; Open files 
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code] 
@="Edit with VS Code" 
"Icon"="D:\\Program Files\\Microsoft VS Code\\Code.exe,0" 
 
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command] 
@="\"D:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\"" 
 
; This will make it appear when you right click ON a folder 
; The "Icon" line can be removed if you don't want the icon to appear 
 
[HKEY_CLASSES_ROOT\Directory\shell\vscode] 
@="Open Folder as VS Code Project" 
"Icon"="\"D:\\Program Files\\Microsoft VS Code\\Code.exe\",0" 
 
[HKEY_CLASSES_ROOT\Directory\shell\vscode\command] 
@="\"D:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\"" 
 
 
; This will make it appear when you right click INSIDE a folder 
; The "Icon" line can be removed if you don't want the icon to appear 
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode] 
@="Open Folder as VS Code Project" 
"Icon"="\"D:\\Program Files\\Microsoft VS Code\\Code.exe\",0" 
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command] 
@="\"D:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\"" 

  1. 替换所有vscode的安装路径。
  2. 双击这个文件,之后都选 “是”。

转载于:https://my.oschina.net/wallenheng/blog/2088226

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值