さて、アップデーターが組み込まれたスクリプトを作成しています。次のコードで新しいファイルを作成し、いくつかの変数を更新しますが、何らかの理由でこれが機能しないため、修正方法や同様のスクリプトを修正する方法がわかりません。ほぼ同じことをします。
@echo off
setlocal enabledelayedexpansion
set /p "findthis"="1"
set /p "replacewith"="1.2.3"
call:updater
set /p "findthis"="2"
set /p "replacewith"="2.3.4"
call:updater
set /p "findthis"="3"
set /p "replacewith"="3.4.5"
call:updater
goto:eof
:updater
for /f "tokens=*" %%a in (updateme.bat) do (
set write=%%a
if %%a==%findthis% set write=%replacewith%
echo !write!
echo !write! >>%~n1.replaced%~x1
)
goto:eof