Hi, I need to know how I can use time as a variable in cleaning out a folder
of old files. Specifically, I need to delete log files older than 6 hours.
Any ideas?

Thanks in advance for any assistance,
Mike Deering

Re: Help with time by Torgeir

Torgeir
Fri Feb 27 09:33:26 CST 2004

"Michael B. Deering" wrote:

> I need to know how I can use time as a variable in cleaning out a folder
> of old files. Specifically, I need to delete log files older than 6 hours.
> Any ideas?

Hi

In the article below there is a WSH script (vbscript) by Michael Harris that
deletes files x days old in a specific folder (and optionally all subfolders).

You can use that as an starting point, it should be pretty easy to
change it into deleting files x hours old instead.

Newsgroups: microsoft.public.scripting.wsh
Date: 2002-10-07 08:12:33 PST
http://groups.google.com/groups?selm=3DA1A19B.DF9B06D7%40hydro.com


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter