If you find your script is generating an error, and then dying before you have the opportunity to review what the error was, you have a couple of options. You can use the GW Toolkit Error Reporting feature to automatically save detailed error reports to a file when errors occur. Or you can use the WScript.Shell object to write directly to the Windows Event Viewer, like this:
Set shellObj = CreateObject("WScript.Shell")
shellObj.LogEvent 0, "This is a test event.", "\\."
You can read more about the LogEvent feature of the MSDN LogEvent page. Additionally, if you decide to use this feature, you should familiarize yourself with the various logging guidelines, available on the MSDN Logging Guidelines page.


