|Purpose:||Write a string to the Windows event log|
|Format:||EVENTLOG [/= /S"source" /Cn /E /I /W] message|
|message||The text to write.|
|source||The source for this message.|
EVENTLOG posts messages to the Windows application event log. You cannot use the command separator character ([&]) or the redirection symbols (| > <) in an EVENTLOG message, unless you enclose the message in quotes or precede the special characters with the escape character.
By default, the text written with EVENTLOG is stored in the event log as informational messages. You can store warning and error messages by using the /W and /E switches.
Messages in the log can be reviewed with the Windows Event Log viewer.
If you do not have proper registry permissions when you execute the EVENTLOG command and/or the key cannot be created, EVENTLOG will fail and display an error. EVENTLOG is primarily intended for use by users with Administrator status. You will also need to be running an elevated session.
|/=||Display the EVENTLOG command dialog to help you set the command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.|
|0 - None|
|1 - Devices|
|2 - Disk|
|3 - Printers|
|4 - Services|
|5 - Shell|
|6 - System|
|7 - Network|
|/I||Store the message as an informational entry in the event log. This is the default if no switch is used.|
|/S||Specify the event log entry source. If you use the /S option, it must be the first option on the EVENTLOG command line. If the source contains white space, it must be double-quoted. For example:|
|eventlog /sCompiling /I Your message here.|