I need some help on a batch script which has to achieve the following :
Thanks in advance to anyone who can give me a hand.
I guess, it would be something like this:
@echo off
Set DirToSearch="D:\MyFolders\"
Set LineToRead="This is my line"
pushd %DirToSearch%
for /r %%f in (*.txt) do (
For /F %%l in ('Findstr /L /I %LineToRead% "%%f"') do (
if %%l equ " " (
echo File:"%%f" is Not OK >> D:\FileStatus.txt
) else (
echo Line: %%l
echo File:"%%f" is OK >> D:\FileStatus.txt
)
)
)
Goto :End
:End
popd
Hope it helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.