BackupEventLog Method

Saves the specified event log to a backup file. This does not clear the event log.


  obj.BackupEventLog(EventLogName string, OutputFolderName string, [MachineName string])
   where obj is an OpScrUtil.EventLog object 


EventLogName Specifies the name of the log file to backup such as Application, System etc.
OutputFolderName Specifies the folder to which the output file should be saved. When backing up event logs from the local computer, this parameter can be a string containing system environment variable (e.g. %TEMP%). On remote computers where the system environment may vary, set this parameter to a specific foldername or an empty string.
SavedFileName Specifies the name of the file to which the eventlog was saved.
MachineName Specifies the target computer. This parameter is optional. If not specified or an empty string, the local computer is the target.

Return Type



To backup the Application eventlog file, enter:

  Set obj = CreateObject("OpScrUtil.EventLog")
  If obj.BackupEventLog("Application", "%TEMP%", varOutFileName)then
	 MsgBox "Your File is saved as " & varoutFileName
	 MsgBox obj.GetError()
  End If

This example shows how create an event log backup file.