Using Windows shortcut with 'cmd /c start' not the same as from console

I'm using this method to launch Anaconda Prompt 32-bit version "open a regular command prompt, figure out where miniconda got installed, cd to the miniconda\Scripts directory and type "activate". Rsignell I'd like to be able to activate this from Cortana/Start Menu, because I'm using both 32 and 64-bit versions.

Following this workaround I added a shortcut:

cmd /c start "C:\path\to\Miniconda3\Scripts\activate"

with the name "Anaconda Prompt (32)". This icon has the right-click contextual Pin to Start option and Cortana can find this 32-bit shortcut.

However, the console that's launched is not an active conda environment: C:\WINDOWS\system32 > and should show up as (conda) C:\WINDOWS\system32 >. The same line used in a console will activate conda. Any suggestions to fix this solution?

1 Answer

The console that's launched is not an active conda environment

You are using the start command incorrectly and it is not executing C:\path\to\Miniconda3\Scripts\activate.

The first parameter for start is the title bar text.

Try using:

cmd /c start "" "C:\path\to\Miniconda3\Scripts\activate"

Usage:

Syntax START "title" [/D path] [options] "command" [parameters]
Key: title Text for the CMD window title bar (required.) path Starting directory. command The command, batch file or executable program to run. parameters The parameters passed to the command.

...

Always include a TITLE this can be a simple string like "My Script" or just a pair of empty quotes "" According to the Microsoft documentation, the title is optional, but depending on the other options chosen you can have problems if it is omitted.

Source Start - Start a program - Windows CMD - SS64.com


Further Reading

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like