I have a line in my config file (.exe.config)
<appSettings configSource="Configuration\local.config" />
And I need use a batch file to change it to
<appSettings configSource="Configuration\production.config" />
Any ideas?
I have a line in my config file (.exe.config)
<appSettings configSource="Configuration\local.config" />
And I need use a batch file to change it to
<appSettings configSource="Configuration\production.config" />
Any ideas?
This is going to be very brittle and prone to error, but if you still want to do it, go ahead:
We need delayed expansion
setlocal enabledelayedexpansion
Iterate over the lines in the file
for /f "delims=" %%L in (foo.exe.config) do (
Store the line
set "Line=%%L"
Do the replacement
set "Line=!Line:Configuration\local.config=Configuration\production.config!"
Output the line again
echo !Line!
)