Torgeir
Fri Jun 24 06:41:46 CDT 2005
Wizard wrote:
> Hi All,
>
> Wonder if somebody could kindly help me? Im fairly new to this so please
> excuse me if I sound daft.
>
> I have a VBS script that copies a file from 1 Directory to Aanother each
> night. The file is Approx 290megs and grows about 2meg per day. Currently
> all is working well however im deleting the previous weeks files manual each
> monday. (Its a backup, and we need seven days worth) as they are starting to
> take up a fair amount of space. Is there a way to get the VBS script to
> check the earlist file and delete it if it is over a week old?
Hi,
A start point maybe:
In the article below there is a WSH script (vbscript) by Michael Harris
that deletes files that has not been modified in x days old in a
specific folder (and optionally all subfolders).
Newsgroups: microsoft.public.scripting.wsh
Date: 2002-10-07 08:12:33 PST
http://groups.google.co.uk/group/microsoft.public.scripting.wsh/msg/14df6623fc552446?dmode=source
For a version that filters on a specified file extension as well:
http://groups.google.co.uk/group/microsoft.public.scripting.vbscript/msg/5b442f482bab6c03?dmode=source&hl=en
--
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/default.mspx