Skip to content

Instantly share code, notes, and snippets.

@danielTobon43
Last active August 27, 2021 02:42
Show Gist options
  • Save danielTobon43/de10a2c327aa7774a6114a9224f3ff93 to your computer and use it in GitHub Desktop.
Save danielTobon43/de10a2c327aa7774a6114a9224f3ff93 to your computer and use it in GitHub Desktop.
Open Conda Prompt Here - Windows

How to add Conda Prompt Here to the right-click menu on Windows 10

Download and run the following .bat files.

Note

You must update the conda path on these files with your own conda path

Registry path

HKEY_CLASSES_ROOT\Directory\Background\shell\ HKEY_CLASSES_ROOT\Directory\shell\

REG ADD HKCR\Directory\Background\shell\prompt_user\ /ve /f /d "Open Prompt Here"
REG ADD HKCR\Directory\Background\shell\prompt_user\command /f /ve /t REG_EXPAND_SZ /d %windir%\System32\cmd.exe
REG ADD HKCR\Directory\shell\prompt_user\ /ve /f /d "Open Prompt Here"
REG ADD HKCR\Directory\shell\prompt_user\command /f /ve /t REG_EXPAND_SZ /d %windir%\System32\cmd.exe
REG ADD HKCR\Directory\Background\shell\miniconda3\ /ve /f /d "Open Conda Prompt Here"
REG ADD HKCR\Directory\Background\shell\miniconda3\ /v Icon /f /t REG_EXPAND_SZ /d C:\Users\Daniel\miniconda3\Menu\Iconleak-Atrous-Console.ico
REG ADD HKCR\Directory\Background\shell\miniconda3\command /f /ve /t REG_EXPAND_SZ /d "%windir%\System32\cmd.exe "/K" "C:\Users\Daniel\miniconda3\Scripts\activate.bat"
REG ADD HKCR\Directory\shell\miniconda3\ /ve /f /d "Open Conda Prompt Here"
REG ADD HKCR\Directory\shell\miniconda3\ /v Icon /f /t REG_EXPAND_SZ /d C:\Users\Daniel\miniconda3\Menu\Iconleak-Atrous-Console.ico
REG ADD HKCR\Directory\shell\miniconda3\command /f /ve /t REG_EXPAND_SZ /d "%windir%\System32\cmd.exe "/K" "C:\Users\Daniel\miniconda3\Scripts\activate.bat"
1. Install powershell 7
2. Set `Computer\HKEY_CLASSES_ROOT\Directory\background\shell\`
2. Set `Computer\HKEY_CLASSES_ROOT\Directory\shell\`
3. `powershell -ExecutionPolicy ByPass -NoExit -Command "& 'C:\Users\Daniel\miniconda3\shell\condabin\conda-hook.ps1' ; conda activate 'C:\Users\Daniel\miniconda3\' "`
4. Prompt-user: `pwsh.exe`
REG ADD HKCR\Directory\Background\shell\prompt_user\ /ve /f /d "Open Prompt Here"
REG ADD HKCR\Directory\Background\shell\prompt_user\ /v Icon /f /t REG_EXPAND_SZ /d "C:\Program Files\PowerShell\7\assets\Powershell_black.ico"
REG ADD HKCR\Directory\Background\shell\prompt_user\command /f /ve /t REG_EXPAND_SZ /d pwsh.exe
REG ADD HKCR\Directory\shell\prompt_user\ /ve /f /d "Open Prompt Here"
REG ADD HKCR\Directory\shell\prompt_user\ /v Icon /f /t REG_EXPAND_SZ /d "C:\Program Files\PowerShell\7\assets\Powershell_black.ico"
REG ADD HKCR\Directory\shell\prompt_user\command /f /ve /t REG_EXPAND_SZ /d pwsh.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment