I am trying to create a batch file which will create some directories, and add some environment variables depending on the user response. However, I cannot get the condition working according to the input:
I just extracted the decision code:
@echo off
set /P answer="Do you want to install the Default configuration? (Home folder will be not created, dev_tools will install con C:\) "
if !answer! == "Y"
echo "Setting environment variables on C:\.. and Default user Folder."
else
echo "Setting environment variables on User Folder."
PAUSE
But when I executed that code, I receive the following message on the CMD window:
The syntax of the command is incorrect.
I just need to print one of the two messages inside the IF.