Skip to main content
The 2024 Developer Survey results are live! See the results
2 of 2
deleted 246 characters in body

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