if/else if/else doesn't work

P

Phillip M. Feldman

When I run the following batch file, all three branches execute. Am I doing something wrong, or is this a Windows bug?


@echo off


IF EXIST "C:\Program Files\Anaconda3" (

echo Branch #1

setx Python "C:\Program Files\Anaconda3"

)

ELSE IF EXIST C:\Apps\Anaconda3_2018.12 (

echo Branch #2

setx Python C:\Apps\Anaconda3_2018.12

)

ELSE (

echo Branch #3

C:\Windows\system32\msg "%username%" ^

"Anaconda3 cannot be activated because an installation was not found in " ^

"'C:\Program Files\Anaconda3' or 'C:\Apps\Anaconda3_2018.12'."

)

Continue reading...
 

Similar threads

Y
Replies
0
Views
23
Yusuf Mehdi, Executive Vice President, Consumer
Y
B
Replies
0
Views
122
Brandon LeBlanc
B
B
Replies
0
Views
122
Brandon LeBlanc
B
B
Replies
0
Views
151
Brandon LeBlanc
B
Back
Top Bottom