Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've written a simple batch script that watches some services and regularly restarts them. I've used the eventcreate command to write to the Windows event log, which seems like a good way of logging my actions, but I notice that the 'category' field is always empty. Can I use this field to put some extra information in? There doesn't seem to be a parameter on eventcreate for it. Or is this reserved for some internal Windows data?

share|improve this question
up vote 1 down vote accepted

The event category isn't a free-form text field-- it's a numeric index (a WORD value, actually) into a table of values that are specified in an event message file (see for technical detail).

Basically, EVENTCREATE doesn't expose the Category value to you, so you can't set it. If you wanted to code something up that called the event logging APIs directly ( and you created an event message file you could certainly use Category. For something lightweight, though, you're probably just better off making up event IDs for your application that can be used for filtering and forget about Category.

share|improve this answer
A very good answer. Thank you. – Colin Pickard Jul 29 '09 at 11:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.