Q. How can I register a script to run based on certain events?

A. It's possible to configure actions to fire based on event IDs. Before Windows Vista and Windows Server 2008, you could trigger based on the eventtriggers.exe command. It's even easier with Windows Vista and later OSs.

  1. Open Event Viewer and select an instance of the event that you want to use as a trigger. Note that you can manually perform this in task scheduler, but this is simpler if you already have an instance of the event ID you want to trigger from.
  2. Select the "Attach Task To This Event" action.
  3. Event Trigger

  4. Enter a name and description for the new task and click Next.
  5. The event details will be displayed. Click Next.
  6. Select the Start a program action (or select e-mail or display a message) and click Next.
  7. Enter the program or script with arguments, if needed, and click Next.
  8. Click Finish.

You now have an action that will trigger based on the event ID configured. It will display under Task Scheduler, Task Scheduler Library, Event Viewer Tasks.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.