@
echo
off
set
Row=
set
Str=
set
"Xstr=1993"
set
"Files=C:WindowsSystem32driversetchosts"
set
"OutputFiles=C:WindowsSystem32driversetc$"
if
exist
"%Files%"
(
setlocal enabledelayedexpansion
for
/f
"delims="
%%a
in
(%Files%)
do
(
set
/a
Row+=1 &
set
"Str=%%a"
((
echo
!Str! | findstr
/i
"!Xstr!"
>nul) && (
echo
Found target text.(发现目标文字!)
)) || (
echo
!Str!>>!OutputFiles!
)
))
move !OutputFiles! %Files%>nul 2>nul
echo
Completed (执行完毕)!!
pause>nul
Leave a reply