Jump to content
Sign in to follow this  
Amaruq

Create custom event

Recommended Posts

Hi,

I have a generated message, consisting of several lines, that has to be inserted as a new event in the event viewer.

I tried with both logevent.exe and eventcreate.exe, and both work BUT ...

If I use @LF or @CRLF to create the new lines then the message is cut after the first LF.

If I use only @CR, I get the complete message but as one line of text, the CR is ignored.

Does anyone have an idea on how to get multiple lines in there ?

Share this post


Link to post
Share on other sites

@Amaruq

This is an extract from a script of mine which logs some events.

If $Column8 = "OK" Then
            Run("eventcreate /T Information /ID 100 /L Application /SO SMART /D " & _
            Chr(34) & "SMART Harddisk Status : "&$Column8 & _
            @CR&"ID"&"  "&"Attribute"&@Tab&@Tab&"Type"&@Tab&"Threshold"&@Tab&" Value"&" "&"Worst"&"   "&"Raw"& _
            @CR&$Column1&" "&$Column2&" "&$Column3&" "&$Column4&@Tab&$Column5&"       "&$Column6&" "&$Column7&Chr(34), "", @SW_HIDE, 2)
        Else
            Run("eventcreate /T Error /ID 999 /L Application /D " & _
            Chr(34) & "SMART Harddisk Status : "&$Column8 & _
            @CR&"ID"&"  "&"Attribute"&@Tab&@Tab&"Type"&@Tab&"Threshold"&@Tab&" Value"&" "&"Worst"&"   "&"Raw"& _
            @CR&$Column1&" "&$Column2&" "&$Column3&" "&$Column4&@Tab&$Column5&"       "&$Column6&" "&$Column7&Chr(34), "", @SW_HIDE, 2)
        Endif

You can modify it to get it going.

regards

ptrex


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...