A quick script to delete files older than a certain number of days, be careful if you run this against a root dir!
'* Script Name: DeleteOldFiles.vbs
'* Created On: 08/08/2013
'* Author: Jimmy White
'* Version: 1.0
'NOTE! The Account used to run script needs delete permissions to folder & files.
Const sSource = "G:\" ' For example, or "X:\" but not "G:"
Const MaxAge = 30 'time in days
Const Recursive = True 'deletes everything under the source
Dim dtOld, Checked, Deleted, verb
dtOld = Now - MaxAge
Checked = 0
Deleted = 0
Validate sSource
Cleanup sSource
Sub Validate(sFolder)
With CreateObject("Scripting.FileSystemObject")
If Not .FolderExists(sFolder) Then
Err.Raise 76 'Path not found
End If
If .GetFolder(sFolder).IsRootFolder Then
If .GetDrive(.GetDriveName(sFolder)) = _
CreateObject("WScript.Shell").Environment(_
"PROCESS")("HOMEDRIVE") Then
Err.Raise 75 'Path/File access error
End If
End If
End With
End Sub
Sub Cleanup(sFolder)
Err.Clear
On Error Resume Next
Dim obj
With CreateObject("Scripting.FileSystemObject").GetFolder(sFolder)
'recurse first
If Recursive Then
For Each obj In .SubFolders
Cleanup obj
Next
End If
'next delete oldest files
For Each obj In .Files
If obj.DateCreated < dtOld Then
Deleted = Deleted + 1
WScript.Echo verb & obj.Path & """"
If Active Then obj.Delete(True)
End If
Next
Checked = Checked + .Files.Count
'and then delete old or empty folders
For Each obj In .SubFolders
If obj.DateCreated < dtOld Or 0 = obj.Size Then
'count here in a variable if you like...
If Active Then obj.Delete(True)
If Err.Number<>0 THen
'do nothing!
End If
End If
Next
End With
End Sub
Solar Garden Lights Outdoor, 50 LED 7M/24Ft Solar String Lights Waterproof 8 Modes Indoor/Outdoor Fairy Lights Globe for Garden, Patio, Yard, Home, Party, Wedding, Festival Decoration (Clear White)
£15.99【8 Gorgeous Lighting】: This 50 LED globe fairy lights have have 8 working modes - Combination, In Waves, Sequential, Slo-Glo, Chasing/Flash, Slow Fade, Twinkle/Flash, Steady on. Can create romantic, soft, cozy atmosphere in all situation. 【Upgrade So... read more
(as of 11th April 2021 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Amazon Ethernet Adaptor for Fire TV
£13.99Connect your Fire TV or your Fire TV Stick directly to your router with an Ethernet cable, no Wi-Fi required Easy to set up: connect the Ethernet Adaptor to your Fire TV or Fire TV Stick, connect the USB cable to the power adaptor and the Ethernet ca... read more
(as of 11th April 2021 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)NETGEAR Wi-Fi Range Extender EX2700 - Coverage up to 600 sq.ft. and 10 devices with N300 Wireless Signal Booster and Repeater (up to 300Mbps speed), and Compact Wall Plug Design with UK Plug, Silver
£17.00EXTENDED WIRELESS COVERAGE: Adds Wi-Fi range coverage up to 600 sq ft, and connects up to 10 devices such as laptops, smartphones, speakers, IP cameras, tablets, IoT devices, and more. Technical Support on 03448 754000 N300 WI-FI SPEED: Provides up t... read more
(as of 9th April 2021 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)AA Batteries pack of 40 by GP AA Batteries Ultra Alkaline - 10 year shelf life, ideal for everyday hungry devices, long lasting power, anti-leakage technology | also known as LR06, MN1500, 15A, AM3
£13.99💛 AA Batteries with 10 year shelf life: this 40 pack of AA batteries is one of the top ranges of GP Batteries, designed for reliable performance in everyday household devices. Due to their long storage life and handy container, these AA alkaline batt... read more
(as of 11th April 2021 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)