Discussion Locked
0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a program that writes temp files out to a folder but doesn't delete them. I need something that can run automaticly that will delete any file older than 3 days (because it still may use temp files up to 3 days old). I know you can use a VB Script to do this but I don't know the first thing about that so if you tell me to use that then you better give me a good example. Or is there a utillity under the windows 2000 Resoruce kit that I could use. Anything would be great. Thanks
5 replies
by bfilmfan
Visual Basic code for that is available here:
http://www.freevbcode.com/ShowCode.Asp?ID=77
Does exactly what you are wanting to do.
Couldn't get it to work but an update by the vendor now deletes these temp files.
by frpieper
Main
Sub Main
Dim Fso
Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Folder
Set Folder = Fso.GetFolder("\\server\Backup\Development")
Dim Files
Set Files = Folder.files
Dim File
Dim FileDateTime
For Each File In Files
FileDateTime = File.DateLastModified
If DateDiff("D", FileDateTime, Date) >= 3 THEN
File.Delete
End If
Next
Set Fso = Nothing
End Sub
Couldn't get it to work but an update by the vendor now deletes these temp files.
This question was closed by the author
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending
0 helpful
11 replies
Question Locked
Do You Save Useful Windows Tutorial Videos for Later
0 helpful
7 replies
0 helpful
1 reply
Question Unanswered
Is WSL still relevant in 2026?
0 helpful
0 replies
0 helpful
2 replies