Jump to content

Writing to Windows Eventlog using "Logevent.exe"


Roman
 Share

Recommended Posts

Hi

I have a little problem i can't resolve:

From the Microsoft Ressource Kit i use "Logevent.exe" (a command line tool) to write my events to the Windows eventlog.

If i do it like this:

RunWait(@COMSPEC & " /c Logevent.exe -s E -r ""MyEvent"" -e 10001 ""My message...""")

all works well!

But now i would like to have a carriage return / line feed befor "My message..." appears to get my text on a new line within the event log. I tryed to implement @CRLF in various ways but without success. :o

I surrend...

Any suggestions?

Thanks, Roman.

Link to comment
Share on other sites

Hi

I have a little problem i can't resolve:

From the Microsoft Ressource Kit i use "Logevent.exe" (a command line tool) to write my events to the Windows eventlog.

If i do it like this:

RunWait(@COMSPEC & " /c Logevent.exe -s E -r ""MyEvent"" -e 10001 ""My message...""")

all works well!

But now i would like to have a carriage return / line feed befor "My message..." appears to get my text on a new line within the event log. I tryed to implement @CRLF in various ways but without success. :o

I surrend...

Any suggestions?

Thanks, Roman.

have you tried just @LF ?
Link to comment
Share on other sites

have you tried just @LF ?

Yes, without success - but your suggestion goes in the right direction: is it possible that a carriage return does "survive" within a parameter of a command-line tool? I don't belive it...

Therefore i think i have to live with it or to change to kiXtart. :">

Thanks, Roman.

Link to comment
Share on other sites

Yes, without success - but your suggestion goes in the right direction: is it possible that a carriage return does "survive" within a parameter of a command-line tool? I don't belive it...

Therefore i think i have to live with it or to change to kiXtart. :">

Thanks, Roman.

i think you're right, i'm going to test a possible work around (would explain it but i don't want to get your hopes up)

Link to comment
Share on other sites

i think you're right, i'm going to test a possible work around (would explain it but i don't want to get your hopes up)

yeah, it looks like you just have to work within the constraints of a single line log, or create your own log. _FileWriteLog() is what i usually use rather than using the built in event logging of windows. then you don't have to worry about using a runasset() or anything else like that either
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...