Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 use dts to delete old files

Author  Topic 

beyonder422
Posting Yak Master

124 Posts

Posted - 2006-03-29 : 12:28:01
I have some vbs code that deletes files that are older than N, and I assume I would plug it into an Active X Script Task, but I'm not sure what the correct syntax is.

Can anyone show me how to convert the below VBS into proper DTS package syntax?

--

Dim fso, f, f1, fc
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("J:\aaaa")
Set fc = f.Files
For Each f1 in fc
If DateDiff("d", f1.DateLastModified, Now) > 7 Then f1.Delete
Next

www.beyonder422.com

beyonder422
Posting Yak Master

124 Posts

Posted - 2006-03-29 : 15:14:16
nevermind, apparently normal vbs syntax works.

www.beyonder422.com
Go to Top of Page
   

- Advertisement -