关闭

Backup / delete event log files

标签: deletecommandapplicationsecuritysystemfile
324人阅读 评论(0) 收藏 举报
分类:

http://www.windows-commandline.com/2011/12/backup-delete-event-log-files.html


We can delete or backup event log files from command line using wmiccommands. The wmic sub command for managing event log files is nteventlog.

Below are the methods available with ‘wmic nteventlog‘ command.

BackupEventlog
ClearEventlog

Backup event log files

We can run the below command to backup a event log file.

wmic nteventlog where filename='logfilename' backupeventlog Backupfilepath

Example:

Let’s backup application event log to the file c:\application.evt. Command for this is as below.

wmic nteventlog where filename='application' backupeventlog c:\application.evt

Command to backup security event log file:

wmic nteventlog where filename='security' backupeventlog c:\security.evt

Command to backup system event log file:

wmic nteventlog where filename='system' backupeventlog c:\system.evt

Delete event log files:

Command to delete event log files is:

wmic nteventlog where filename='logfilename' cleareventlog

Examples:
Command to delete application event log file:

wmic nteventlog where filename='application' cleareventlog

Command to clear system event log file:

wmic nteventlog where filename='system' cleareventlog

Command to clear security events log file:

wmic nteventlog where filename='security' cleareventlog


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:79096次
    • 积分:1122
    • 等级:
    • 排名:千里之外
    • 原创:23篇
    • 转载:58篇
    • 译文:1篇
    • 评论:2条
    文章分类
    最新评论