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
||Specifies the name of the log file to backup such as Application, System etc.|
||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.|
||Specifies the name of the file to which the eventlog was saved.|
||Specifies the target computer. This parameter is optional. If not specified or an empty string, the local computer is the target.|
To backup the
eventlog file, enter:
Set obj = CreateObject("OpScrUtil.EventLog") If obj.BackupEventLog("Application", "%TEMP%", varOutFileName)then MsgBox "Your File is saved as " & varoutFileName Else MsgBox obj.GetError() End If
This example shows how create an event log backup file.