VBcode

 Dim directoryPath As String = "C:\Path\To\Your\Directory"

' Get all files in the specified directory Dim files As String() = Directory.GetFiles(directoryPath) ' Iterate through each file and pick only those with size greater than zero bytes For Each filePath As String In files Dim fileInfo As New FileInfo(filePath) If fileInfo.Length > 0 Then Dts.Events.FireInformation(0, Nothing, $"Picking file: {filePath} - Size: {fileInfo.Length} bytes", String.Empty, 0, False) ' Perform actions with the selected file (replace this line with your logic) ' For example, you can copy the file, move it, or perform any other operation. ' For demonstration purposes, we'll just print a message. ' Your logic goes here Else Dts.Events.FireInformation(0, Nothing, $"Skipping empty file: {filePath}", String.Empty, 0, False) End If Next Dts.TaskResult = ScriptResults.Success