Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I need to Find the presence of a String in the first line of a file and if its available then do a set of actions else exit

setlocal
set /p a=<file.txt
if "%a:searchstring=%" == "%a%" then (
echo searchstring NOT found in file.txt
) else (
echo searchstring FOUND in file.txt
)

![]() |
Create a batch fiile
|
move file based on text i...
|
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |