Can SSIS File System Task handle multiple files with "Move file" Operation?

  • I have a File System Task which uses a SourceVariable to set source files.

    My SourceVariable was passed from previous steps and contains something like "C:\Temp\File01*.*".

    I intend to move all files started with prefix "File01" to be moved to destination directory.

    However, I got the following error:

    [File System Task] Error: An error occurred with the following error message: "Illegal characters in path.".

    It's complaining about the * in my path. However, I don't know the filenames beforehand. Is there anyway to get around it?

  • You could try a FOREACH container - put your File System Task in it and it should move all of the matching files one by one - after just a little bit of config.


  • Thanks for the suggestion! Would you please elaborate a little more?

    I couldn't figure out how to set the "Enumerator configuration" in the Foreach Loop (Foreach File Enumerator) container using variables. How can I pass my directory variable (C:\Temp) and File variable (File01*.*) to Folder and Files fields respectively?

  • Sure thing. Edit the Foreach container, click on Collection, select Expressions and set the Directory and Filespec properties to retrieve the contents of your variables.


  • Got it. Thanks a lot, Phil!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply