You should not do 2 separate if statements, the one should include the other in the else statement, else you will get both results tool name.exe and unknown tool name simply because if matches the first, but not the second:
@echo off
:select
set /p tool=Please enter the tool name:
If /i "%tool%"=="fw-test.exe" (
echo "The tool name is fw-test.exe"
) else (
If /i "%tool%"=="ick-test.exe" (
echo "The tool name is ick-test.exe"
) else (
echo Unknown Tool please retry
goto select
)
)
Note that I am evaluating both sides of == with double quotes. Else you will never get a match. This is wrong: if var=="var" as the one is not quoted where this: if "var"=="var" will match exactly. I Included the /I option as well as it will allow for the name to be typed as FW-TEST.exe as well as mixed case.
if you were planning on only using selected pre-defined tools, simply use choice instead. It will allow the user to only choose one of the 2 tools:
@echo off
echo 1. fw-test.exe
echo 2. ick-test.exe
choice /c 12 /m "Select a tool"
goto tool%errorlevel%
:tool1
Set "tool=fw-test.exe"
goto show
:tool2
Set "tool=ick-test.exe"
goto show
:show
echo you have selected %tool%
pause
@echo offand check the command echoes. What do you enter in theset /Pprompt causing the syntax error?