I'm trying to put some XML code into a variable in a batch script so that I can create a file containing the XML. I also want to change one part of the XML dynamically when the script is run.
Here's how I think it should work
set MYUSERNAME=%USERNAME%
set string=
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
<HostApplication>
<Name>Microsoft SQL Server Management Studio</Name>
<Version>*</Version>
</HostApplication>
<Addin>
<FriendlyName>USAddin</FriendlyName>
<Description>Union Square Addin for SQL Management Studio</Description>
<Assembly>C:\Users\MYUSERNAME\Documents\Visual Studio 2010\Projects\USAddin\USAddin\bin\Debug\USAddin.dll</Assembly>
<FullClassName>USAddin.Connect</FullClassName>
<LoadBehavior>1</LoadBehavior>
<CommandPreload>0</CommandPreload>
<CommandLineSafe>0</CommandLineSafe>
</Addin>
</Extensibility>
echo string > "somefile.txt"
MYUSERNAMEin the XML should be replaced with theMYUSERNAMEgiven in the batch file?