I have a batch code which creates certain variables. However, I want to add an IF statement so that if the user enters "Technology" for the first variable, it then creates another variable and asks for additional information. A python script then reads these variables for further processing.
Here is the code:
set constraint_type=1 set constraint_technology=1 set /p constraint_type="Enter constraint type (E.g. "Equipment" or "Technology"): " IF /I !constraint_type!=="Technology" set /p constraint_technology="Enter Technology name: " cmd /k python "script.py" %constraint_type% %constraint_technology% @echo on The code runs but the user isn't prompted for the constraint_technology variable. Am I missing something?
IF /I !constraint_type!=="Technology"-->IF /I "%constraint_type%"=="Technology"(normal%expansion, and quotes to avoid trouble with empty entry)