On Tuesday, November 2, 2004, at 6:22:28 PM, Günther Eisele spewed
forth what is to be beheld below:

> found a vbs script which deletes files older than a configurable amount of
> days in a configurable directory:

Translated into English, and only deleting bat*.tmp files:



Directory = "C:\temp"
Keepdays    = 3

Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(Directory)
Set files = folder.Files
Set reg = New RegExp
reg.Pattern = "bat.*\.tmp"

today = Date()
For Each file In files
  If (file.DateLastModified < (today - Keepdays) And reg.Test(file.Name)) Then
    file.Delete
  End If
Next


-- 
 |\  /|      \~~~/     \~~~/
 | \/ |  /\   > <  \~/  > <    ICQ# 3146019
 |____| /__\ /___\ /_\ /___\    IQ# 3.14159
Famous last words: "Umm... Can I UN-cast that Fireball?  I think it
made him mad."

Flyin' high with The Bat! v3.0.1.33
over the swamps of Windows 2000 5.0 build 2195 Service Pack 4


________________________________________________________
 Current beta is 3.0.2.4 Rush | 'Using TBBETA' information:
http://www.silverstones.com/thebat/TBUDLInfo.html
IMPORTANT: To register as a Beta tester, use this link first -
http://www.ritlabs.com/en/partners/testers/

Reply via email to