简体   繁体   中英

Windows Server 2012, CMD and Anaconda CMD need .bat extension to run batch files in PATH

Running on Windows Server 2012.

I've installed Anaconda on my machines, it automatically adds the relevant paths to PATH variable:

C:\\Users\\user1\\tools\\Anaconda3;C:\\Users\\user1\\tools\\Anaconda3\\Scripts;

From within cmd, it won't allow me to use anaconda to execute the batch file. I must use anaconda.bat .

This is the same with all batch files, I've tested it with many. Any idea why and if so, how to fix this?

Your asking a command line to execute a file. Computers are stupid. You'd still have to tell it to activate the .bat file. Its not like linux that will run the program. What you could do. Is make a small batch file.

Like:

Start C:\Windows\MY_ANACONDA_DONT_WANT_NONE\anaconda.bat

Then name it something like anaconda.bat And place it in your PATH. (by PATH, I mean the one your CMD links to like "C:\\Windows\\System32 folder on your computer.")

Then you should just be able to punch in anaconda and it will open it up.


The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM