Re: Delete all .processed files

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"billious" <billious_1954@xxxxxxxxxxx> wrote in message
news:4a007510$0$12588$5a62ac22@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Crikey!

Perhaps if a real programmer had stopped by, they'd have suggested

DEL /s *.processed

from the command-prompt.

But real programmers are becoming rare nowadays.

I disagree. A *REAL* programmer would have obfuscated the code even more!

A *REAL* scripter would have been more likely to come up with the simple
solution.

/Al

"Stacey" <Stacey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:315CED02-16C5-4ED8-BCD5-B4574A533E87@xxxxxxxxxxxxxxxx
Okay 20 minutes after this post a programmer stopped by.


sub recurse( byref folders)

Set regEx = New RegExp
regEx.Pattern = "\.processed$"
regEx.IgnoreCase = True


set files = folders.files
wscript.echo ""
wscript.echo "Deleting Files under the Folder:" & folders.path
wscript.echo
"__________________________________________________________________________"
for each file in files

if regex.test(file.name) and file.datelastmodified < newdate then
wscript.echo "Deleting " & folders.path & "\" & file.name & " last
modified: " & file.datelastmodified
on error resume next
file.delete
end if

next


It worked.


"Stacey" wrote:

First I am not a programmer. I have done a little scripting.

Here is the problem:


Ha a program that creates log files Audit1.log, audit2.log ect. in
c:\logs
. Another program comes along and reads the file into its database and
renames the file audit1.log.proccessed.

I have tried to write a script that will delete any files with
.processed
but it will not work. I belive the problem is that it reads from left to
right and sees the .log only.

Any ideas?

Thank you




.



Relevant Pages