Jump to content
Sign in to follow this  
roman

Writing to Windows Eventlog using "Logevent.exe"

Recommended Posts

roman

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.

Share this post


Link to post
Share on other sites
seandisanti

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 ?

Share this post


Link to post
Share on other sites
roman

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.

Share this post


Link to post
Share on other sites
seandisanti

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)

Share this post


Link to post
Share on other sites
seandisanti

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

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  

×