find string from multiple files and replace it without creating new file

I want to find string e.g. "date" from my files of a folder which contains multiple ".c" and ".h" files in it and replace it with "date 24-April-2018" using batch file. what should do? Please see below code. I want to do the same but not for one file Input.txt , I want to do for multiple files with extensions of a folder

@echo off
setlocal enableextensions disabledelayedexpansion
set "search=@date"
set "replace=@date 24-apr-2018"
set "textFile=Input.txt"
for /f "delims=" %%i in ('type "%textFile%" ^& break ^> "%textFile%" ') do ( set "line=%%i" setlocal enabledelayedexpansion >>"%textFile%" echo(!line:%search%=%replace%! endlocal
)
4 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like