I am making a .cmd/.bat file to launch my applications. It give the user 2 choices for what they want to do, and is supposed to run the function for that choice:
::setup
@echo off
color 02
title The Portal
::screen text
echo ---------------
echo.
echo Welcome, AT-3109
echo.
echo ---------------
echo What would you like to do?
echo.
echo 1: Code
echo 2: Edit an image
::choices
set /p taskChosen=Choice:
if taskChosen==1 (
call codeStuff
)
if taskChosen==2 (
call imageEdit
)
::functions
:codeStuff
start %cd%appvscodiumVSCodium.exe
:imageEdit
start https://pixlr.com/editor
However, when I select an option, no matter which, the .cmd file runs both functions.
I tried running the commands directly from the if statement, expecting this to fix the issue:
::choices
set /p taskChosen=Choice:
if taskChosen==1 (
start %cd%appvscodiumVSCodium.exe
)
if taskChosen==2 (
start https://pixlr.com/editor
)
This unfortunately resulted in nothing happening at all.
AT-3109 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.