@echo off if %date:~0,2% neq 01 goto :eof setlocal enabledelayedexpansion set verfile=E:\Bat\VERSION.txt set tmpfile=E:\Bat\VERSION.tmp if exist %tmpfile% del /q %tmpfile% for /f "delims=" %%a in (%verfile%) do ( set /a flag=0 echo %%a|>nul find /i "="&&set /a flag=1 if !flag!==1 ( for /f "tokens=1-2 delims==" %%i in ("%%a") do ( if %%i==CONFIG_VER (echo %%i=01%date:~3,2%%date:~-2%>>%tmpfile%) else (echo %%i=%%j>>%tmpfile%) ) ) else ( echo %%a>>%tmpfile% )) copy /y %tmpfile% %verfile% >nul del /f /q %tmpfile% >nul