i find a batch files. I modify some place.now i have a trouble about how to define search file path.
i hope first auto search file: 1.txt in c disk.
and relpace LastLogin to LastLogin=zl in 1.txt.
Who can help me.
Code: Select all
@echo off
set "filename=1.txt"
echo In the search, please wait...
for %%a in (C) do (
if exist %%a:\nul (
for /f "delims=" %%b in ('dir /a-d /s /b "%%a:\*%filename%" 2^>nul') do (
if /i "%%~nxb" equ "%filename%" (
cd /d "%%a:\
pause
(for /f "delims=" %%o in ("%filename%") do (
for /f "delims==" %%d in ("%%o") do (
if %%d==LastLogin (
echo LastLogin=zl
) else echo;%%o
)
))>tme.txt
move /y tme.txt 1.txt
:del tme.txt
start "" "%filename%"
echo.%%b
)
)
)
)
pause