• You could also acomplish this within a script task. Let's assume you have the following variables:

    FileDirectory, string, C:\TEMP

    FileName, string, SomeFileName.csv

    Imports System

    Imports System.Data

    Imports System.Math

    Imports Microsoft.SqlServer.Dts.Runtime

    Imports System.IO

    Public Class ScriptMain

    Public Sub Main()

    Dim strDate As DateTime = DateTime.Now

    Dim strNewFileName As String

    strNewFileName = "SampleName" & DateTime.Now.ToString("yyyyMMdd") & ".txt"

    'Another Example to use yesterday's date

    'strNewFileName = "SampleName" & DateTime.Now.Subtract(New TimeSpan(1, 0, 0, 0)).ToString("yyyyMMdd") & ".txt"

    '

    Try

    File.Move(Dts.Variables("FileDirectory").Value.ToString & "\" & Dts.Variables("FileName").Value.ToString, Dts.Variables("FileDirectory").Value.ToString & "\" & strNewFileName)

    Dts.Events.FireInformation(0, "", "File Renamed Succesfully", "", 0, True)

    Catch ex As Exception

    Dts.Events.FireError(0, "", "Source File Does Not Exist", "", 0)

    End Try

    'For Debugging Purposes

    'System.Windows.Forms.MessageBox.Show(Dts.Variables("FileDirectory").Value.ToString & "\" & Dts.Variables("FileName").Value.ToString)

    Dts.TaskResult = Dts.Results.Success

    End Sub

    End Class