none
Making the Excel File ready only after copy and rename

    Question

  • Greetings!

    I've created an SSIS package where it does the following -

    1. Import data to Excel file (foo.xlsx) which is in Folder C:\Test

    2. Next, that Excel file gets renamed by appending datetime stamp, i.e. foo_201309041800.xlsx

    3. Next, that renamed file will be move to a different folder C:\Final

    My question is, how can I set the file - foo_201309041800.xlsx to READ-ONLY ? Everytime I run the package new files will be copied to C:\Final folder like

    foo_201309041800.xlsx

    foo_201309041810.xlsx

    foo_201309041925.xlsx

    Based on my question, all the above files should set to READ-ONLY.

    Please let me know if you have any ideas.

    Thanks.


    • Edited by SQL01 Wednesday, September 04, 2013 11:12 PM typo
    Wednesday, September 04, 2013 11:11 PM

Answers

  • Thanks for replying. We came up with a solution by providing Read acces (except who runs the package) on folder level where excel files are being copied rather than provided Read Only access to the each excel file.
    • Marked as answer by SQL01 Saturday, September 07, 2013 10:04 PM
    Saturday, September 07, 2013 10:04 PM

All replies

  • If you are fine using DOS commands through SSIS then you can try ATTRIB command to set the read only attribute of the file.
    • Proposed as answer by cruellogic Thursday, September 05, 2013 3:59 AM
    Thursday, September 05, 2013 3:12 AM
  • Thanks for replying. We came up with a solution by providing Read acces (except who runs the package) on folder level where excel files are being copied rather than provided Read Only access to the each excel file.
    • Marked as answer by SQL01 Saturday, September 07, 2013 10:04 PM
    Saturday, September 07, 2013 10:04 PM