This article helped to steer me on the write path so I wanted to let everyone know how I went about doing this. I am searching a text file for errors and if I find one, I wanted to write a custom event to the event viewer with a custom source and custom ID number.
Code:
'## write the custom event to event viewer - chr34 is inserting quote within quote
CmdLine = "eventcreate /l Application /t ERROR /so ERS /id 100 /d " & chr(34) & ErrorMessage[this is another variable i defined earlier] &_
". Please contact ERS technical to resolve" & chr(34)
objWSHShell.Run CmdLine
This creates an error event in the event viewer with a source of ERS and an event ID of 100 with my custom error message. mmcdonal's post above is very helpful. Hope this helps