打开注册表
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。