運用のためにスクリプトを書く場合など、ログを出力するのは大変重要です。
LogEventメソッドを使うと、イベントログにエントリを作成することができ、イベントビューアで確認できます。
Option Explicit
Dim WshShell, retVal, message
Set WshShell = WScript.CreateObject("WScript.Shell")
retVal = SomeFunction()
message = GetMessage(retVal)
Call WshShell.LogEvent(retVal, message)
Function SomeFunction()
End Function
Function GetMessage(val)
End Function