Set Variable FILECONTENT to
Set Variable EOF to FALSE
while Variable EOF Equals FALSE loop
Read from Text File C:\Program Files (x86)\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX.exe.config into Variable FILECONTENT (get EOF into EOF)
Replace <add key="XXXFolder" value="C:\XXXXXXXXXX Service\"/> with <add key="XXXFolder" value="C:\Testing\"/> in variable FILECONTENT
Write into Text File C:\Program Files (x86)\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX.exe.config.new from Value $FILECONTENT$ (at end of file)
wend
Run Program c:\Windows\System32\cmd.exe /c del "C:\Program Files (x86)\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX.exe.config" && copy "C:\Program Files (x86)\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX.exe.config.new" "C:\Program Files (x86)\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX.exe.config" && del "C:\Program Files (x86)\XXXXXXXXXX\XXXXXXXXXX\XXXXXXXXXX.exe.config.new" (WAIT)
I can of course change multiple lines within the same loop, but I don't feel that this is a good solution, it would be nice if the function within the application worked (or was easy to understand and/or get working).
I'm not a developer, I just want to install things...
Also, the issue with the is that it will only work if the XML content is the initial value being looked for in the replace statements, if it has been changed previously the line will not be updated.
Any ideas on how I can get around that? a nested if statement within the loop with a contains checking the key name?! #urrrrrrrgh
Then how would I replace the entire line?
I'm not a developer, I just want to install things...