Try to delete a file, but SSIS think it is a path

I have a process that reads file with different extension, at the end I will either move or delete the file.  Below is the code.
I can run it with success if debug locally, it failed when trying to run the package.  Below is the error:
The file received does not have extension - item_2290.seq
Error message: Access to the path 'E:\myfolder\item_2290.seq' is denied.
I tried different method and none worked, on if I delete the driectory.  I donot want to recreate the dir each time.  Please help, I am pulling my hair and no luck.
Below is the code:
foreach
(var srcfile
in
new
DirectoryInfo(SourceFilePath).GetFiles())
if (File.Exists(targetFilePath
+ srcfile.Name) == true)
srcfile.Delete();
else
File.Move(SourceFilePath + srcfile.Name, targetFilePath + srcfile.Name);
W.E. Pan

When you say "it failed when trying to run the package" do you mean that it failed when running from SQL Agent but that it didn't fail when running from Visual Studio?  If so, then the SQL Agent service account doesn't have permission
to move files from the folder "E:\MyFolder"  You need to give the service account permission or better yet create a proxy account. 
http://www.mssqltips.com/sqlservertip/2163/running-a-ssis-package-from-sql-server-agent-using-a-proxy-account/ 
Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

Similar Messages

  • Asking for my password when I try and delete a file

    I have a few files that I can't seem to delete without the computer asking for my password. When I try and delete them, it shows this message:
    Authenticate
    Finder requires that you type your password
    Then the window has fields for my name and password. Under the Details arrow it says this:
    Requested right: com.apple.desktopservices
    Application: /System/Library/CoreServices/Finder.app
    I'm not happy with having to provide my password just to delete a file. And not all files produce this result. Why does it do this?
    Cheers,
    Tina

    Select the folder containing the file in the Finder and choose Get Info from the File menu; if the file is on the desktop, click on the desktop so that no icon is selected. Under Ownership & Permissions, change the settings so you have Read & Write access to the folder. This should not be done in system-level folders.
    You will be asked to enter your password when you try to delete the file in the following circumstances:
    1. If the folder you're deleting the file from is set not to allow you write access. This is the most common case.
    2. If the folder containing the file has the Locked checkbox set. This cannot be turned on or off in the Finder in versions of Mac OS X older than 10.4. If this was the case, you would be told that you didn't have permission to delete the file even after entering your password.
    3. If the enclosing folder has the sticky bit set and neither the file nor the enclosing folder are owned by your account. No item in your home folder should have the sticky bit set, but other parts of the hard disk(such as /Users/Shared/ and the hard disk itself) do.
    (11194)

  • After accepting update to my time capsule, I can no longer complete a backup because there is not enough space.  I tried deleting old files, but it doesn't seem to work.  Any advice:

    My time capsule was updated through an apple download update on June 16, and now I cannot back up my computer.  The message is that there is not enough space.  I tried deleting my files, but it didn't help.  any suggestions?

    How much space is there according to airport utility?
    TM can be fussy.. Do a factory reset of the TC and give it a new name. Use short, no space and pure alphanumeric type names..
    And reset TM. See A4 here. http://pondini.org/TM/Troubleshooting.html
    Then set up TM again to the TC and see if TM will start .. the reset will not hurt the backup and TM can still find it on a renamed TC.

  • I try to delete last backup but witn no success

    I try to delete last backup but witn no success

    To delete a device backup you need to do it on your computer and not on your device because the backup is saved on the computer not the device

  • I have MacBook,the disk is already full.when I open it I can't see the icons below.im trying to delete my files but I can't...

    I have MacBook,the disk is already full.when I open it I can't see the icons below.im trying to delete my files but I can't...what should I do?my screen shows only color blue screen and apple icon,file,edit,view,share,window and help on the upper left of the screen...

    If she can't remember the ID/password, she will need to go to https://iforgot.apple.com to recover it/reset the password or she will have to call Apple and speak to someone in account security.

  • Can only open firefox as admin, otherwise get error to say a security component could not be initilaised. Have tried deleted cert8 file but it is not recreated and still will not open

    Had problems with os and now can not open firefox unless I run as admin. Error appears - Could not initialise the application's security component. The most probable cause is problems with files in your browser's profile directory. Please check that this directory has no read/write restrictions and your hard drive is not full or close to full. It is recommended that you exit the browser and fix the problem. If you continue to use this browser session, you might see incorrect browser behaviour when accessing security features.
    I have tried deleting the cert8 db file but it is not recreated when I start firefox again. HD has lots of room. Can you suggest anything else to try please?
    thanks, mandi

    If deleting or otherwise removing the cert8.db and secmod.db file doesn't help then try a new profile.
    *https://support.mozilla.org/kb/Could+not+initialize+the+browser+security+component
    Create a new profile as a test to check if your current profile is causing the problems.
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer some files from an existing profile to the new profile, but be careful not to copy corrupted files.
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Pages temporarily deleted my files but won't redownload them

    From what I've been told by a friend, the iWork apps will temporarily delete the files in them so that you have more space for better functionality. They will then redownload them from the iCloud when you need them. I think my Pages was in the process of redownloading my files when i decided to close it as i had to go on and do other things. Now i have no idea how to get my ipad to continue redownloading the files. I've tried closing and opening it and I've left it for a few days but nothing has happened.
    This is a photo of what my screen looks like: (Note this is on my Ipad 3)
    Any help is greatly appreciated !

    Just some extra information, i do have space in my icloud. 2.8gb to be exact

  • Itunes error 3194 i delet host file but error sitll not go

    i have error 3194 problem .itry many time but error still not go.i delet my host file but error still.i use widose .please help me please

    If you run into the "another installation" message even after the reboot of the PC (which is an excellent idea by HTP ProXy), reregistering your Windows Installer Service is worth a try.
    First, launch a command prompt as an administrator. In your Start search, type cmd then right-click on the cmd that comes up and select "Run as administrator".
    At the command prompt:
    Type %windir%\system32\msiexec.exe /unregister and hit enter.
    Type %windir%\syswow64\msiexec.exe /unregister and hit enter.
    Type %windir%\system32\msiexec.exe /regserver and hit enter.
    Type %windir%\syswow64\msiexec.exe /regserver and hit enter.
    Restart the PC and try another reinstalll.

  • Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files but still have them on the TC for future reference..

    Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files on iMac 20inch but still have them on the TC for future reference..eg some movies on iTunes. I want to directly save them on the drive so I can delete them from iTunes and gain some storage. (Ps on iMac 20 inch (it's almost full - 320 GB) when I enter time machine, a tab comes up on finder which reads "Time Machine backups" it's able to be ejected like a disc or a connected device. On the iMac 20 inch, I dragged some files onto there as if using it like a hard drive. Is this the correct method? Then I went to my 27inch iMac and saw the "Time Machine Backups" hoping to see the files I dragged from the 20inch iMac. But the files were not there except a folder that said "Backups.backupdb". Can someone help me?

    It's not a good idea to use a network disk for both Time Machine backups and other things.  By design Time Machine will eventually consume all the space on its output disk, which will then cause problem for your other files.  I'd store those other files on an external disk connected to the Time Capsule.  The problem with that is that Time Machine will only back up files that are local to your Mac.  That means that you'll only have one copy of the files on or attached to your Time Capsule.
    By the way, you've been misled by poor field labeling on this forum into typing a large part of your message into the field intended for the subject.  In the future just type a short summary of your post into that field and type the whole message into the field below that.

  • How to delete alias files? I already delete the files but the alias is still at ALL MY FILES under MOVIES? Please help.

    "The alias "title.TS.Xvid.MP3-ADTRG.mp4.vc.m4v" can't be opened because the original item can't be found." How to delete this file?

    Drag it to the Trash. (Mac 101).

  • HELP. I deleted some files, but they are still in the Nib I think

    I have royally messed up. I'm working on a cocoa app with various Quartz Compositions in it using QC View's. The .qtz files have been loaded into the Nib via the QC View's, but by accident I have deleted the original .qtz files from my disk.
    I can still build the application and the views work as it seems the .qtz files must be cached into the nib file. However I can't get to them to save them back to my disk. Is there any way to get a .qtz file out of a nib after its been loaded in. Perhaps some way to reverse save the file out to disk?
    Sorry its so rambling, its just that I've spent weeks getting these compositions right and now I've gone and deleted them I'm beside myself
    I have tried looking inside the the nib file with 'Show package contents' but none of the .qtz files are in there. How are they cached in the nib?
    Thanks you for any help. I'm also trying various file recovery apps, but so far no luck.
    Mark

    I tried all sorts of utilities to get the files back, but no luck. So I sat down with plenty of coffee and retraced my work as best I could remember.
    After a full days work, I have recreated all the files and actually made quite a few improvements along the way!! Although I lost some time, I actually ended with a better end product, so not such a disaster after all

  • While replaying ajax truclient scipt in loadrunner i am getting "this connection is untrust" error in the 40th step. I tried by deleting cert8 file but no use

    while replaying ajax truclient script in loadrunner 11.0, getting error "this connection is untrust" page in 40th step. Add this exeception permanently check box is disable when i got the exeception certificate file. i tried with by deleting cert8.db file in loadrunner ajax truclient profile but still same result.
    can any one guide me to resolve this issue...

    Is that content loaded in an iframe?
    You can check that via the right-click context menu to see if there is a "This Frame" item.<br />
    If that is the case then try top open the frame in a new tab or otherwise check the Technical Details of the error message.

  • Deleted original file, but have movie on DVD (movie I made)

    I was cleaning up my computer the other day and for some reason I thought it would be a good idea to delete the iDVD project I used to create my movie. I still had the movie's file, so I thought, so I did not need the iDVD project. Well, I deleted the project and now when i try to open the movie it will not open. I did not export the movie to Quicktime before I deleted it. Is there a way I can download my video back to my computer so I can have a copy on my PC. I would like to be able to watch it on my iPod.

    Not 100% sure where your movie currently lives; on the computer, on the ipod or perhaps neither at this point in time. But apparently you did produce a completed iDVD ..... is this correct?
    If so there is another app you can use to extract the video from the completed DVD (perhaps at a somewhat lesser quality) and then import back into iMovie in the form of a QT file (which should play fine on the ipod as well). And then if you wish export to iDVD, or whatever else you wish to do with it. Recommend you review the following link. Try the demo ... it's a free 30 day trial / download ....as opposed to paying for additional roxio products. Popcorn will also work, but why pay if you can get the same results free?
    I happen to also own roxio popcorn as well. It's a great product to compress extra long movies onto a standard DVD-R media. However, I'm not sure i'd want to reimport that highly compressed data right back into iMovie.
    http://www.dvdxdv.com/DVDxDV.overview.htm
    SDMacuser

  • I want to delete my file, but when I press the "delete", the file becomes "reject". How can I change back to real "Delete" ??

    I just bought a macbook pro two days ago, and it is my first Macbook.
    I want to delete some pics in my macbook, but when I press the "delete" key,
    the files became "reject". How can I change it back to a real "delete" ?
    Thank You !

    Use Boot Camp Assistant to remove the partition containing Windows. You do this from the Mac OS X partition and do not need to boot into Windows.
    http://www.iclarified.com/entry/index.php?enid=20949

  • E71, deleted music files but album names still the...

    Hi there ,just got E71 loades a couple of albums then tried to delete them song files went ok but album names still there. Music refresh does nothing, any one any ideas....thanks
    Solved!
    Go to Solution.

    hi Can you tell me what procedure you followed to delete tha albums? Whether it was from phone or PC suite? I am using E71 and i am nor facing any such issue

Maybe you are looking for

  • How text getting printed?

    Hi experts, I am creating a text template for my client. In the text template my client wants to know which text is getting copied from quotation to order, order to delivery, delivery to invoice and also my client wants to know which the text is gett

  • Use only half of a transition?

    Looking to use only the first half of a transition between two clips. Previously you could align a transition with the beginning or ending of a clip but not seeing that in FCPX... Pic below illustrates. Essentially I want the first clip to transition

  • Cost for Production at Site

    Dear All , I want to capture the cost of the work caried out at my customers site by employees of my company. I have near about 100 sites at present and my project tenure is about 2 to 3 years How can i collect the cost similar to the production orde

  • Ipad mirroring onto tv but iphone mirroring will not even though it's on airply

    IIpad mirroring works on airplay but iphone mirroring on airplay does not show on tv with Apple TV

  • How do i get a border o a jpeg

    how do i get a border o a jpeg.