Home > Uncategorized > How To Write An Event In Windows Log When Your Script Started And When Is Completed

How To Write An Event In Windows Log When Your Script Started And When Is Completed

December 17th, 2009 Angel Leave a comment Go to comments

Description

Windows event log is the most easy way to save the events related with your scripts.

For example this can be used to know if a scheduled task is successful.

Solution.

You need to use the following code:

Set Wsobject = CreateObject(" WScript.Shell ")
Wsobject.LogEvent 4, "Script started."

‘ Here comes your visual basic script. 

Wsobject.LogEvent 0, "Script completed."

Related posts:

  1. How To Retrieve The Name And Links Of Every Entry In A RSS Feed?
  2. How To Know That A Web Page Has Changed
  3. Desktop Icon Missed From Quick Launch
  4. How To Execute A Program With Other User Not Showing The Password
  5. How To Make Scheduled Tasks In Windows XP
Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.