By David Wiseman (Administrator)Created 08 Feb 2008
My Rating:
Vote
Rating:
Not Rated
Views:8554
Downloads:171

Backup Event Log with Unique File Name

Language:  VBScript

Compatibility

Windows XP Yes Windows 2003 Yes
Windows 2000 Yes Windows NT Yes
Vista Unknown Windows 2008 Unknown
Description

Backs up and clears the Application event log, generating a unique file name for each backup based on the current date.

Code

Line Numbers: On  Off      Plain Text
dtmThisDay = Day(Date)
dtmThisMonth = Month(Date)
dtmThisYear = Year(Date)
strBackupName = dtmThisYear & "_" & dtmThisMonth & "_" & dtmThisDay

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate,(Backup)}!\\" & _
        strComputer & "\root\cimv2")

Set colLogFiles = objWMIService.ExecQuery _
    ("Select * from Win32_NTEventLogFile where LogFileName='Application'")

For Each objLogfile in colLogFiles
    objLogFile.BackupEventLog("c:\scripts\" & strBackupName & _
        "_application.evt")
    objLogFile.ClearEventLog()
Next

 


Got a useful script? Click here to upload!


 

  Post Comment
Order By:  
User Comments
      
sameer9
Posted On: 6/28/2019 12:23:44 PM

On the site, there is some information about some school named St Andrews School Delhi Holiday Homework. Check top resume surveys now. There is nothing distinct for clients to comprehend it better so it would be better on https://www.analyzedu.com/writing-services-reviews/grabmyessay-com-review.html . Any sort of assistance would be energized and we should part of such site to visit regularly.

MK handbags
Posted On: 7/9/2019 4:13:29 AM

If you are looking for authentic MK Outlet and you want good deals, you can look to buy online on Michael Kors Crossbody Sale. There's always a Michael Kors Store to accompany her and make sure it's the be-all of her womanly needs. So it's the best place that they find these Cheap Michael Kors Purses. Tags: Michael Kors Handbags Sale,Michael Kors Outlet Online,Michael Kors Purse Outlet The only gripe about getting Coach Factory and Coach Handbags Clearance is that there are merchants who sell non-authentic ones passing off as the original. Imagine genuine Coach Purses Outlet selling for between 90% to 60% off retail! Tags: Coach Handbags Outlet,Coach Bags Outlet

Homlessman
Posted On: 7/24/2019 10:08:34 AM

hank you TC! I totally agree, without love– what’s the point of a relationship? https://www.loveawake.com/free-online-dating/United-States/state-of-Pennsylvania.html

lifetime
Posted On: 9/14/2019 9:45:37 AM

so happy to find good place to many here in the post, the writing is just great, thanks for the post. What is The Law Of Attraction?

lifetime
Posted On: 9/14/2019 10:38:00 AM

Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post . Achieve Goals With the Law of Attraction

lifetime
Posted On: 9/14/2019 11:02:07 AM

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. How To Manifest Anything You Want in 24 Hours

lifetime
Posted On: 9/14/2019 11:31:13 AM

I read your post and I found it amazing! thank! Make Money Online Writing from Home

lifetime
Posted On: 9/14/2019 12:01:49 PM

You completed certain reliable points there. I did a search on the subject and found nearly all persons will agree with your blog. Benefits of Bitter Leaf

lifetime
Posted On: 9/14/2019 1:26:53 PM

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. Best Nail Polishes

lifetime
Posted On: 9/14/2019 4:53:26 PM

Hi! This is my first visit to your blog! We are a team of volunteers and new initiatives in the same niche. Blog gave us useful information to work. You have done an amazing job! Best False Eyelashes

lifetime
Posted On: 9/14/2019 5:01:41 PM

The material and aggregation is excellent and telltale as comfortably. Perfumes for Women

lifetime
Posted On: 9/18/2019 11:13:38 AM

I was taking a gander at some of your posts on this site and I consider this site is truly informational! Keep setting up.. recycling fluorescent lamps

lifetime
Posted On: 10/12/2019 6:06:41 PM

This website and I conceive this internet site is really informative ! Keep on putting up! Costruction

lifetime
Posted On: 10/12/2019 7:25:36 PM

A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one. Construction

lifetime
Posted On: 10/12/2019 7:25:38 PM

A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one. Construction

12