Link to home
Start Free TrialLog in
Avatar of bpp2444
bpp2444Flag for United States of America

asked on

VB Script to clear out log files

I need a script that will automatically clear out  log files older then a week and runs daily.   I'm a complete novice when it comes to VBScript so any and all help setting this up would be appreciated.  
Avatar of chandru_sol
chandru_sol
Flag of India image

Are you referrring to the log files in the eventviewer or the log files stored in any of the folders.
Avatar of bpp2444

ASKER

Both would actually be helpful ;)
ASKER CERTIFIED SOLUTION
Avatar of chandru_sol
chandru_sol
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bpp2444

ASKER

Alright I have to add to this cause like I said I'm really new to this, in turn I will bump the points up to 500 ;)))  What is my best option to set this up to run daily at a specific time???  Do I just put this in a specific folder and set a basic dos script to run everyday?  Thank you for your help chandru sol.  
Hi,

I would suggest just run a scheduled task daily and you can select the file. Before that you save the above script as delold.vbs and select the same file in the scheduled task to run everyday.

Avatar of bpp2444

ASKER

Thats what I was thinking just wanted to be sure, good deal ;)))  I will try this out.  
Avatar of RobSampson
Hi guys, just thought I'd put in my 2 cents....Event Logs from the Event Viewer cannot be partially cleared.  It is all or nothing......but they *can* be backed up and stored for import again later.

Regards,

Rob.