Copy Files Using File System Task in SSIS

In this article, we show you how to Copy Files Using File System Task in SSIS with example. To Copy the complete Directory, Please refer to Copy Directory Using File System Task article.

TIP: In SSIS, Please use the Foreach Container to Copy multiple files from one location to another location.

We have File System Task Folder inside the MSBI Folder. Our task is to Copy the cache.xml file inside the File System Task Folder to Copied Folder inside F Drive.

Copy Files Using File System Task in SSIS 1

Files inside the Copied folder are:

Copy Files Using File System Task in SSIS 1

Copy Files Using File System Task in SSIS

To Copy Files Using File System Task in SSIS, First Drag and drop the File System Task into the Control Flow region and rename it as Copy File Using File System Task in SSIS

Copy Files Using File System Task in SSIS 1

Double click on it will open the File System Task Editor to configure it.

In this example, we are Copying a single file. So, change the operation property to Copy File

Copy Files Using File System Task in SSIS 2

Let us configure the Source Connection by selecting the SourceConnection property. If you already created the File Connection Manager before then select the created one or If you stored the Source Connection in the Variable then, please change the IsSourcePathVariable property to TRUE and select the Variable Name.

Here, we are selecting <New Connection..>.

Copy Files Using File System Task in SSIS 3

Once you click on the <New Connection..> option, File Connection Manager Editor opened to configure. Here, we are Copying the existing file, so select the Existing File option from the Usage Type.

Click on the Browse button to select the Existing File from the file system.

Copy Files Using File System Task in SSIS 4

From the above screenshot, you can see we selected the Cache.xml file

Copy Files Using File System Task in SSIS 5

Click Ok to finish configuring the Source connection. Now we have to set the Destination Connection. So, select the DestinationConnection property. If you have already created the File Connection Manager before, select it. Or If you saved the Destination Connection in a Variable, change the IsDestinationPathVariable field to TRUE and select the Variable Name.

We don’t have any connection Manager. So, We are selecting <New Connection..>.

Copy Files Using File System Task in SSIS 6

In this example, we are Copying the existing file to an already existing folder. So, select the Existing Folder option from the Usage Type.

Copy Files Using File System Task in SSIS 7

Click on the Browse button to select the Existing Folder from the file system.

Copy Files Using File System Task in SSIS 8

From the preceding screenshot, you can observe that we selected the Copied Folder as the destination folder. Click the Ok button to select it.

Copy Files Using File System Task in SSIS 9

Click Ok to finish configuring the File Connection Manager for the destination.

Copy Files Using File System Task in SSIS 10

Next, Click Ok to finish configuring the Copy Files Using File System Task in SSIS package. Let’s run and see whether we successfully Copied the Cache.xml file using the File System Task or Not.

Copy Files Using File System Task in SSIS 11

Well, We successfully Copied the Cache.xml file present in the File System Task Folder to the Copied Folder.

Copy Files Using File System Task in SSIS 12