Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write event log using vbscript

I want to write event log when this vbscript run. How to i can?

Thanks for any help.

like image 363
Emree Avatar asked Sep 23 '11 20:09

Emree


2 Answers

Like so:

Set shell = CreateObject("WScript.Shell")
shell.LogEvent 4, "Your Message Here"

The 4 is a severity level. You can learn more about the LogEvent method on MSDN.

like image 67
vcsjones Avatar answered Sep 28 '22 00:09

vcsjones


This is old but I'm sure still valid.

http://msdn.microsoft.com/en-us/library/b4ce6by3

You also need permissions to be able to write to the event log so depending on the user running the script you may or my not have access.

like image 33
Gratzy Avatar answered Sep 28 '22 02:09

Gratzy