Writing Command Shell Script Status to the Application Event Log - 19 Feb 2002
Centralize management of your administrative scripts Windows 2000 and Windows NT command shell scripts are great tools for automating repetitive administrative tasks. Scripts are easy to write and rel
February 18, 2002
Centralize management of your administrative scripts Windows 2000 and Windows NT command shell scripts are great tools for automating repetitive administrative tasks. Scripts are easy to write and reliable, and you can use the AT scheduler or the Win2K Task Scheduler to schedule and run the scripts unattended. However, scripts are limited in the kinds of tasks they can perform. For instance, scripts have no built-in support for accessing the Registry or the event log. The inability to write to the event log can be particularly annoying for unattended scripts, which must record their run status information in standalone text files, which you need to manage separately from the event log.
You can get around this limitation by using the Logevent utility to tell your command shell scripts to record run status and error information in the Application event log. The Application log is a common repository for applications' status information. If you tell your scripts to write their status information to the Application log, you can have all your script and program status information in one place.
Logevent is in both the Microsoft Windows NT Server 4.0 Resource Kit and the Microsoft Windows 2000 Server Resource Kit. You can call Logevent from a batch file, and because the utility is a standalone executable binary file, it's convenient to use. You don't need to do anything special to install it-it doesn't need any Registry entries or DLLs. Just make sure that the command shell script can find the logevent.exe file.
About the Author
You May Also Like