Say I include a .zip file with some files, namely my batch script (Which is 90% complete) and a .ini with the name "game-WINDOWSNAME.ini" and inside said ini are a couple lines
vid_defheight=y
vid_defwidth=x
And I want my batch script to be so upon running it, it asks for "screen res x" for "vid_defwidth=x" and screen res y for "vid_defheight=y" and the user inputs a value for each one, say for example "1920 and 1080" and then the .ini changes said lines to match e.g.
vid_defheight=1080
vid_defwidth=1920
How do I do this?
[Edit : add-in code-in-use]
So I made this based on more googling, but all it does is read the file into the console. Could someone tell me what I'm doing wrong?
@echo off &setlocal
set "search=oldcrapx"
set "replace=1920"
set "textfile=zdoom-WINDOWSNAME.ini"
set "newfile=zdoom-%username%.ini"
(for /f "delims=" %%i in (%textfile%) do (
set "line=%%i"
setlocal enabledelayedexpansion
set "line=!line:%search%=%replace%!"
echo(!line!
endlocal
))
pause