This should work
**names.txt**
host1
host2
host3
**check.bat**
@echo off
setlocal EnableDelayedExpansion
set /p name=Enter the host name
FINDSTR /L /C:%name% names.txt
IF %ERRORLEVEL% EQU 0 echo "found" ELSE echo "not found"
pause
This should work
**names.txt**
host1
host2
host3
**check.bat**
@echo off
setlocal EnableDelayedExpansion
set /p name=Enter the host name
FINDSTR /L /C:%name% names.txt
IF %ERRORLEVEL% EQU 0 echo "found" ELSE echo "not found"
pause