title: How do I insert a date/timestamp before the contents I'm trying to append to a text file with this simple .vbs?
body: <p>I'm using this script to add text to a variety of .txt's on the fly:</p>
  
  <pre><code>Const ForAppending = 8
  
  Set objArgs = WScript.Arguments
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  
  If objFSO.FileExists(objArgs(1)) Then
      Set objFile = objFSO.OpenTextFile(objArgs(1), ForAppending)
  Else
      Set objFile = objFSO.CreateTextFile(objArgs(1))
  End If
  
  objFile.WriteLine objArgs(0)
  objFile.Close
  </code></pre>
  
  <p>So I'm sending text with the program launchy this .vbs (addln.vbs) -</p>
  
  <p>("$$" c:\ideas.txt) is what the argument is if I want to send to ideas.txt for example</p>
  
  <p>All I want to do is make it so I get the date and time right before whatever text I send to this text file. I don't think this would be too complicated... thanks for any pointers!</p>