Free Newsletters:
DatabaseDaily  
Database Journal
Search Database Journal:
 
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum DBA Videos
internet.com

» Database Journal Home
» DBA Videos
» Database Articles
» Database Tutorials
MS SQL
Oracle
MS Access
MySQL
DB2
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» DBA Jobs
» Sitemap

News Via RSS Feed



follow us on Twitter

Marketplace Partners
Be a Marketplace Partner

internet.commerce
Be a Commerce Partner


















Mariposa Bot Shipped With Vodafone Smartphone

IT Job Market Heating Up: Report

Bing Makes Strides But Momentum Stalls

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Database Journal | DBA Support | SQLCourse | SQLCourse2







Systems Engineer Sr - Solaris - Linux (TX)
Next Step Systems
US-TX-Houston

Justtechjobs.com Post A Job | Post A Resume

Featured Database Articles

SQL Scripts & Samples

April 20, 2009

Delete Older Files



>>Script Language and Platform: VBScript
This script will delete old files from a given folder and all subfolders.

Usage:

cscript deloldfiles.vbs c:\dba\log 7

This script will delete all the files older than a week.

cscript deloldfiles.vbs c:\dba\log 2

This script will delete all the files older than 2 days.

Result:


Started deleting files older than :6/21/2005 9:28:51 AM
________________________________________________

Deleting Files under the Folder:C:\DBA\log
__________________________________________________________________________
Deleting C:\DBA\log\BACKUP_20050621.log last modified: 6/21/2005 12:25:59 AM
Deleting C:\DBA\log\THRESHOLD_offhours_20050620.log last modified: 6/20/2005 11:46:01 PM
Deleting C:\DBA\log\TRANLOGBAK_20050620.log last modified: 6/20/2005 10:30:03 PM
Deleting Files under the Folder:C:\DBA\log\dddd
__________________________________________________________________________
Deleting C:\DBA\log\dddd\THRESHOLD_offhours_20050620.log last modified: 6/20/2005 11:46:01
Deleting Files under the Folder:C:\DBA\log\x
__________________________________________________________________________
Deleting C:\DBA\log\x\BACKUP_20050621.log last modified: 6/21/2005 12:25:59 AM
Deleting C:\DBA\log\x\PERFMON_20050620.csv last modified: 6/20/2005 11:45:02 PM
Deleting C:\DBA\log\x\Perfmon_20050620.log last modified: 6/20/2005 11:45:02 PM
Completed deleting files older than :6/21/2005 9:28:51 AM

Author: MAK


Download Script:
deloldfiles.vbs_


Disclaimer: We hope that the information on these script pages is valuable to you. Your use of the information contained in these pages, however, is at your sole risk. All information on these pages is provided "as -is", without any warranty, whether express or implied, of its accuracy, completeness, or fitness for a particular purpose... Disclaimer Continued


Back to Database Journal Home



Tools:
Add databasejournal.com to your favorites
Add databasejournal.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

SQL Scripts & Samples Archives








Latest Forum Threads
SQL Scripts & Samples Forum
Topic By Replies Updated
Hello, can anyone help?? terryammon 1 February 7th, 07:39 PM
Question on adding a count to an existing query without effecting original result nelson 2 January 26th, 04:08 PM
search substring (same format) from one column nuonuo 0 January 25th, 11:10 PM
uid find in OID cmontr 1 September 24th, 09:05 AM









The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers