I am trying to write to xml file using a batch script, however it only writes the last loop to the file. The variable Project_Choice is just two comma separated strings. It prints to the console correctly, however writes only the last loop in the xml file. Where am I going wrong?
for %%i in (%Project_choice%) do (
echo(^<?xml version="1.0" encoding="utf-16" ?^>
echo(^<testConfiguration^>
echo(^<TestEvents^>
echo(^<TestEvent^>%%i^</TestEvent^>
echo(^</TestEvents^>
echo(^</testConfiguration^>
)> C:\cijobscript\Test.xml