Interactive PowerBasic Forum

Legacy Software (PBWIN 9.0+/PBCC 5.0+) => Source Code => Scripting => Windows Script Host => Topic started by: José Roca on July 14, 2008, 07:17:45 AM

Title: IWshShell2.LogEvent Method
Post by: José Roca on July 14, 2008, 07:17:45 AM


The following code logs SUCCESS in the log file.

JScript

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.LogEvent(0, "Logon Script Completed Successfully");


VBScript

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.LogEvent 0, "Logon Script Completed Successfully"


PowerBASIC

DIM pWsh2 AS IWshShell2
pWsh2 = NEWCOM "WScript.Shell"
pWsh2.LogEvent 0, UCODE$("Logon Script Completed Successfully")