Need to edge out the competition for your dream job? Train for certifications today.
Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Open in new window
keep in mind file has many other parameters and I want to change only one
This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.
REM Adds a parameter value to an existing parameter field in a text file PFile. e.g.
REM AddParam params.txt param2 newval2
REM PFile structure assumption:
REM Makes new parameter file newfile.txt in current folder. Adjust the path & filename to your needs.
if exist %PNewFile% del /q %PNewFile%
if [%PFile%] equ  echo Missing Parameter filename& exit /b 1
if [%PField%] equ  echo Missing Parameter field name to revise& exit /b 1
if [%PNewVal%] equ  echo Missing Parameter value to add& exit /b 1
if not exist %PFile% echo File %PFile% does not exist& exit /b 1
find /i "%PField%=" %PFile%>nul
if %errorlevel% gtr 0 echo Parameter field: %PField% not found& exit /b 1
for /f "tokens=1-2 delims==" %%a in ('type %PFile%') do (
if /i [%PField%] equ [%%a] (
echo [%PField%] equ [%%a]
echo %PField%=%%b;%PNewVal%>> %PNewFile%
) else (
echo %%a=%%b>> %PNewFile%
if [%found%] equ  del /q %PNewFile%& exit /b 1
exit /b 0
AddParam params.txt param2 newval2
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment