I have the following VBScript:
Dim strFile, strXPath, strNewText, xmlDoc, xmlNodes, xmlNode
strFile = "C:\folder\cats.xml"
strXPath = "/list/cat/@LAST_BATH"
strNewText = Now
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = "False"
xmlDoc.Load(strFile)
Set xmlNodes = xmlDoc.selectNodes(strXPath)
For Each xmlNode in xmlNodes
xmlNode.Text = strNewText
Next
xmlDoc.Save strFile
XML file:
<?xml version="1.0" ?>
<list>
<cat NAME="Monkey" LAST_BATH="9/30/2010 3:02:02 PM" />
</list>
The above script is only 1KB. I also have a small C#.NET console app (.exe) that does exactly the same thing, but it is 11KB, and the App.config is 1KB (config file so the path and field name is not hard-coded).
What I intend to do is create a Scheduled Task to run the above process at some interval.
Which is better to use, the .vbs or the .exe? And why?
Does the difference in memory affect performance? I assume the .exe is faster because it is pre-compiled, but since the .vbs is so small, I'm guessing it's about as fast as you could ever want anyway.
(I realize this is a moot point, but I'm just curious. Thanks for you patience.)