I have a small JScript code that needs to output its error messages. It is running from a Windows Scripting Host (as a .js file). I was wondering if it's possible to write into the Windows Event Log from it?
This blog does it this way:
function Log(message) {
var shell = new ActiveXObject("WScript.Shell")
shell.Exec('eventcreate /id 1 /l [LOG] /SO [SOURCE] /T ERROR /D "' + String(message).replace('"', '""') + '"')
}