Working with files and the FileSystemObject ' Delete File Option Explicit Function Main() Dim oFSO Dim sSourceFile Set oFSO = CreateObject("Scripting.FileSystemObject") sSourceFile = "C:\SourceFile.txt" ' Check if file exists to prevent error If oFSO.FileExists(sSourceFile) Then oFSO.DeleteFile sSourceFile End If ' Clean Up Set oFSO = Nothing Main = DTSTaskExecResult_Success End Function in sqlwith dts