Windows 7 Visual Studio代码“;用“代码”打开;右键单击文件夹后不显示
刚刚在Windows 7计算机上安装了Visual Studio代码1.1.1。当我右键单击文件夹时,“用代码打开”不会出现 复制自Windows 7 Visual Studio代码“;用“代码”打开;右键单击文件夹后不显示,windows-7,visual-studio-code,windows-7-x64,Windows 7,Visual Studio Code,Windows 7 X64,刚刚在Windows 7计算机上安装了Visual Studio代码1.1.1。当我右键单击文件夹时,“用代码打开”不会出现 复制自 使用此内容创建文件vsCodeOpenFolder.reg(如果未选择默认安装路径,则需要调整此文件中的路径): 双击它以创建注册表项 如果“用代码打开”没有出现在浏览器的上下文菜单中,那么您应该重新启动系统 如果您正在运行64位或内部版本的VS代码,请相应地更改路径 NB:这是针对32位版本的,对于64位版本,请参阅Cepharum的答案 对上一个答案稍作修
- 使用此内容创建文件vsCodeOpenFolder.reg(如果未选择默认安装路径,则需要调整此文件中的路径):
- 双击它以创建注册表项
- 如果“用代码打开”没有出现在浏览器的上下文菜单中,那么您应该重新启动系统
- 如果您正在运行64位或内部版本的VS代码,请相应地更改路径
- 使用此内容创建文件vsCodeOpenFolder.reg(如果未选择默认安装路径,则需要调整此文件中的路径):
- 双击它以创建注册表项
- 如果“用代码打开”没有出现在浏览器的上下文菜单中,那么您应该重新启动系统
基本上,我已经用HKEY_CURRENT_USER\Software\CLASSES替换了HKEY_CLASSES\u ROOT这些设置通常存储在每个用户的VS代码中 要设置新用户帐户:重新运行安装程序。安装(或重新安装)时,请选中所有复选框,尤其是: 将“用代码打开”操作添加到Windows资源管理器文件上下文菜单
将“用代码打开”操作添加到Windows资源管理器目录上下文菜单
我希望这能有所帮助。我想补充一点,许多人喜欢使用注册表方法,因为他们担心可能会丢失所有设置。只需重新下载(如果您还没有下载文件)并重新安装。重新安装时,勾选
Add "Open with Code" action to Windows Explorer file context menu
Add "Open with Code" action to Windows Explorer directory context menu
正如在其他答案中已经说过的那样。您的设置将保持不变。事实上,当它启动时,它会与您的工作目录一起启动,就好像您从未卸载过它一样。下面是Cockney Rhyming Jedi提供的文件版本,该版本适用于Visual Studio代码的64位版本:
Windows Registry Editor Version 5.00
; Open files
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code\command]
@="\"C:\\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_CURRENT_USER\Software\Classes\Directory\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
@="\"C:\\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_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""
当vs代码用户具有标准用户角色时,通常会发生此问题。在VS代码安装时,弹出管理提示,这意味着VS代码已作为管理员用户安装。如果您勾选了复选框,则会添加快捷方式,但仅应用于安装时在管理员提示中键入的管理员帐户
快速解决方法是将当前用户(将使用vs代码的用户)临时添加到administrators组,卸载vs代码,然后使用当前用户管理员权限再次安装vs代码,并在安装后从admin组中删除该用户。早期版本的vs代码64位也存在同样的问题。通过检查上述选项,即使在我重新安装之后,它也不起作用 我已经安装了代码v1.25.0的最新更新,并且该问题已自动修复
请查找64位regedit修复程序。上述注册表项中没有一项适用于我的标准(非管理员)用户帐户 然后我把所有的钥匙都插入了HKEY_LOCAL_机器,然后它就工作了
Windows Registry Editor Version 5.00
; when you right click a file
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\VSCode]
@="Open with Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\VSCode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
; when you right click a folder
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VSCode]
@="Open Folder in Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\VSCode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
; when you right click a folder while holding shift
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\VSCode]
@="Open Folder in Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\VSCode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""
; when you right click the background, not on a particular file or folder.
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\LibraryFolder\Background\shell\VSCode]
@="Open Folder in Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\LibraryFolder\Background\shell\VSCode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""
我的vscode安装在此处:
C:\Users\saber\AppData\Local\Programs\Microsoft VS Code\code.exe
应使用您的pc用户名替换SABER
vscode://file/{full path to file}
vscode://file/c:/myProject/package.json
所以脚本是s.th,如下所示:
将此内容另存为.reg脚本文件,第一行为:Windows注册表编辑器版本5.00
然后运行它:
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Users\\saber\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Users\\saber\\AppData\\Local\\Programs\\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"="\"C:\\Users\\saber\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"C:\\Users\\saber\\AppData\\Local\\Programs\\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"="\"C:\\Users\\saber\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"C:\\Users\\saber\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%V\""
将visual studio代码添加到windows中的右键单击文件夹
如果您已经安装了vscode,并且希望使用“用代码打开”选项,请将
\\saber\\\
替换为\\PC\U用户名\\
只需从官方网站下载vscode。。。
!
运行安装程序时,选中“使用代码打开”选项
它将使用“用代码打开”选项更新现有的vscode安装。只需在选择了“文件资源管理器中打开”选项的情况下再次运行安装程序即可。你会准备好的
不要担心已经在vsCode中打开的文件,它们都不会被更改尝试查找Microsoft vs Code文件—有时它位于默认位置,有时位于C:\Users\PAPPU KUMAR\AppData\Local\Programs\Microsoft vs Code中 然后将其添加到vscode.reg(创建一个)文件中
粘贴下面的代码并使用.reg扩展名保存
Windows Registry Editor Version 5.00 ; Open files
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code] @="Edit with VS Code"
"Icon"="C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe,0"
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code\command]
@="\"C:\Users\hp\AppData\Local\Programs\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_CURRENT_USER\Software\Classes\Directory\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe",0"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
@="\"C:\Users\hp\AppData\Local\Programs\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_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe",0
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]
@="\"C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\Code.exe" \"%V\""
然后按Windows键,找到Visual Studio代码,然后右键单击并打开文件位置:
单击鼠标右键,然后单击“属性”,然后复制文件路径
打开regedit
:
对于以下各项,双击图标,然后粘贴从上面复制的文件路径:
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code]
[HKEY_CURRENT_USER\Software\Classes\*\shell\Open with VS Code\command]
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode]
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]
如果您更喜欢使用键盘而不是鼠标。这个解决方案是给你的 在文件资源管理器(位置)中键入以下命令 打开一个项目
vscode://file/{full path to project}/
vscode://file/c:/myProject/
vscode:// --opens vscode for current directory
打开文件
vscode://file/{full path to file}
vscode://file/c:/myProject/package.json
将文件打开到行和列
vscode://file/{full path to file}:line:column
vscode://file/c:/myProject/package.json:5:10
来源:
示例:
只需重新运行安装程序,选择安装程序中的选项,然后让它安装即可。你不会丢失任何数据。一切都会像以前一样完好无损。它只是添加缺少的设置并更新路径。按照此步骤,您肯定会在资源管理器中使用代码打开。 为什么您没有得到这个,因为您在安装时没有将它添加到visual studio代码中,备份您的项目,如果您有, 对于Windows用户,只需执行以下步骤:
vscode://file/{full path to file}
vscode://file/c:/myProject/package.json
vscode://file/{full path to file}:line:column
vscode://file/c:/myProject/package.json:5:10
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will handle right clicking on a folder and open that folder
; as a new project
[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
; This handles the case of right clicking inside of a folder
; to open that folder as a new project
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""