title: VBscript to edit xml file
body: <p>Need help using a VBscript to edit a single XML file.  I've found many examples to edit xml values and I've frankensteined them to edit my xml file, but have not been successful.</p>
  
  <p>My  xml file looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; 
  - &lt;configuration&gt;
    &lt;add key="kiosk_identifier" value="PC1" /&gt;  
    &lt;add key="kiosk_gui_skin" value="FLA" /&gt; 
    &lt;/configuration&gt;
  </code></pre>
  
  <p>I would like the script to go in and edit value "PC1" to a variable entered by the user in an input box.  My bastardized code looks as follows.  </p>
  
  <pre><code>Set xmlDoc = _
    CreateObject("Microsoft.XMLDOM")
  
  xmlDoc.Async = "False"
  xmlDoc.Load("C:\Scripts\Configuration.xml")
  
  Set colNodes=xmlDoc.selectNodes _
    ("//configuration['@add key'='PC1']")
  
      strNAME = Inputbox("Enter a hostname:", "Hostname Config", "HOSTNAME")
  
  For Each objNode in colNodes
     objNode.Text = strNAME
  Next
  
  xmlDoc.Save "C:\Scripts\Configuration.xml"
  </code></pre>