Variable cannot contain any of the following characters

  • I am trying to use a File System Task to rename a file to use the current date in the name and I found some examples online on how to do this. Most examples want you to create a variable with the new file path and then use expressions on the name property to set the current date.

    The problem I have is setting the file path in the variable. I can try something simple like c:\ as the string value and I get the error "cannot contain any of the following characters" because of the \. I set the EvaluateAsExpression property to True but I still get the error. What am I doing wrong?

  • If I put the task in a sequence container and create the variable in that scope then I can use a file path with back slashes in it and it works. It doesn't like to bo a package variable for some reason.

  • Firstly it needs to be C:\\ for it to work regardless of the scope as the backslash always requires an escape character before it i.e., "\"

  • divyanth (7/29/2010)


    Firstly it needs to be C:\\ for it to work regardless of the scope as the backslash always requires an escape character before it i.e., "\"

    I tried that too in the package scope and it didn't work. I am not escaping the \ in the sequence container and it works fine there.

Viewing 4 posts - 1 through 3 (of 3 total)

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