rem echo off rem for /f "skip=1 eol=d delims= " %%a in (a.txt) do echo %%a rem for %%i in (a.txt) do echo %%i @echo off Echo Saving MDM lib directory.. if exist C:\Users\ww\Desktop\MDMlibd.txt del C:\Users\ww\Desktop\MDMlibd.txt for /r "C:\app\test" %%i in (*.*) do echo %%~nxi>>C:\Users\ww\Desktop\MDMlibd.txt timeout 1 :retry echo (A) to add patch for your system, (B) to install patch for your system. set /p i=Please tell me you options: if "%i%"=="a" (goto addpatch) if "%i%"=="b" (goto installpatch) goto retry :addpatch echo add patch goto :eof :installpatch echo install patch for /f %%i in (file.txt) do ( rem echo %%i findstr /i "%%i" "C:\Users\ww\Desktop\MDMlibd.txt" || del c:\app\test\%%i ) goto :eof