@echo off & setlocal enabledelayedexpansion
for /f "delims=_" %%i in ('dir /b /o:n /ad "H:\Batch\test"') do echo %%~ni &set "s=!s!%%~ni"
for /f %%j in (H:\Batch\test\1.txt) do echo iStandTra Official release: %%j & set "t=%%j"
if "!s:%t%=!" == "!s!" (echo NO) else (echo YES)
pause
请及时点击【采纳回答】