打开注册表
win+S ⇒\Rightarrow⇒ regedit
进入目录
计算机\HKEY_CLASSES_ROOT\Directory\Background\shell

新建项
在 shell 目录下新建项 Anaconda_shell,如上图。
该项包含两个值:
- 右键菜单中的名称
- 右键菜单中的图标

在 Anaconda_shell 目录下新建项 command,该项的默认值为需要执行的指令:

具体格式参考:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\Anaconda3]
@="Anaconda3 Prompt Here"
"Icon"="你的anaconda路径\\Menu\\Iconleak-Atrous-Console.ico"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Anaconda3\command]
@="cmd.exe /s /k \"title Anaconda3\" && 你的anaconda路径\\Scripts\\activate.bat 你的anaconda路径 && activate tensorflow && jupyter notebook"
上述命令不仅打开了 prompt,还激活了 tensorflow env,并打开了 jupyter notebook。
博客介绍了在 Windows 系统中通过注册表设置右键菜单的方法。先通过 win+S 打开 regedit 进入注册表,在 shell 目录下新建 Anaconda_shell 项,设置右键菜单名称和图标,再在其目录下新建 command 项,设置默认值为需执行的指令,还给出了具体格式参考。
1万+

被折叠的 条评论
为什么被折叠?



