To create a script that allows you to start Miniconda by typing it in the Windows Explorer address bar, you can follow these steps:
- Create a batch file: First, create a batch file (.bat) that launches Miniconda. Right-click in an empty space on your desktop and select "New" > "Text Document." Rename the file to
start_miniconda.bat and change the extension from .txt to .bat. Now, open the batch file with a text editor (e.g., Notepad) and add the following line:
@echo off
call "C:\path\to\miniconda\Scripts\activate" "C:\path\to\miniconda"
Replace "C:\path\to\miniconda" with the actual path where you installed Miniconda.
-
Pin the batch file to Quick Access: This step is optional but makes it easier to access the script. Right-click the batch file on your desktop, choose "Send to" > "Desktop (create shortcut)." Then, right-click the shortcut, select "Pin to Quick Access" (or "Pin to Taskbar" if you prefer).
-
Create a custom protocol: To be able to launch the batch file from the Windows Explorer address bar, you need to create a custom protocol. Open Notepad and paste the following content:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\miniconda]
@="Miniconda Launcher"
"EditFlags"=dword:00000002
[HKEY_CLASSES_ROOT\miniconda\shell]
[HKEY_CLASSES_ROOT\miniconda\shell\open]
[HKEY_CLASSES_ROOT\miniconda\shell\open\command]
@="\"C:\\path\\to\\start_miniconda.bat\""
Again, replace "C:\path\to\start_miniconda.bat" with the actual path to your start_miniconda.bat file. Save the file as miniconda_protocol.reg.
- Merge the registry file: Before merging the registry file, make sure you have permissions to modify the registry. Right-click the
miniconda_protocol.reg file and select "Merge." Confirm any prompts that appear.
Now, you should be able to type miniconda: in the Windows Explorer address bar and press Enter to start Miniconda. Note that this will only work if Miniconda is not already running, as the protocol will open another instance.
Remember that modifying the registry can be risky. Always make sure to back up your registry or your entire system before making changes.