Thanks Satya for the support.
This is a csv file and here is the code i am using to create/rename it.
First it checks if the file with yesterdays date is there, if yes then it renames the file to todays date. and if not there then it creates a new file.
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.IO
Public Class ScriptMain
Public Sub Main()
Dim srcFile1, dstFile1 As String
Dim var1 As Variables
Dts.VariableDispenser.LockOneForWrite("Path1", var1)
srcFile1 = var1("Path1").Value.ToString() & Date.Now.AddDays(-1).ToShortDateString().Replace("/", "") & ".csv"
dstFile1 = var1("Path1").Value.ToString() & Date.Now.Date.ToShortDateString().Replace("/", "") & ".csv"
If File.Exists(srcFile1) Then
File.Copy(srcFile1, dstFile1, True)
File.Delete(srcFile1)
Else
File.Create(dstFile1)
End If
var1.Unlock()
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
Thanks!