I am attempting to check whether the first argument passed to the file is python
, if so I would like to go to a particular block. It feels like I'm misunderstanding something about the way batch files test for equality.
@echo off
IF ("%1"=="python") (GOTO py) ELSE (echo %1)
GOTO end
:py
IF ("%2"=="") (echo ) ELSE (.\Programs\Anaconda\condabin\conda.bat activate %2)
.\Programs\Anaconda\python
GOTO end
:nextpy
:end
The output of this file when called D:>launcher.bat python
is:
python
I expect it to instead open a python shell.