• how do I tell this script task to write that "DestPath" to my variable?

    Three steps:

    1. Set up a variable to hold the changed file name. For this example I'm going to call it NewName.

    2. In the script task editor, list NewName in the ReadWriteVariables on the Script screen.

    3. In the Script code, add a line that says:

    Dts.Variables("NewName").Value = DestPath

    FileIO.FileSystem.CopyFile(SourcePath, DestPath)

    FileIO.FileSystem.DeleteFile(SourcePath)

    Dts.Variables("NewName").Value = DestPath

    Dts.TaskResult = ScriptResults.Success

    That should take care of it.