Showing posts with label usng. Show all posts
Showing posts with label usng. Show all posts

Wednesday, March 7, 2012

File System Task - How to Move Directory Contents

Hi,

I want to move all files of one directory/folder into another usng SSIS, like in DOS Prompt we use the command,

Move d:\ftpSource\*.* d:\ETLSource

I have tried by creating a file system task, but there is no option for Move Directory Contents. Move File is not accepting wild cards.

Regards,

Imran.

Hi,

U can use 'move directory'. But both source and destination should have same root and if the destination folder already exists. Also it will work as a rename folder. So either the destination folder should not exist or u should set the 'overwrite destination' property to true which will delete the destination folder before renaming the source. U better do it thru 'File' object in Script task.

|||

Imran Shaikh wrote:

Hi,

I want to move all files of one directory/folder into another usng SSIS, like in DOS Prompt we use the command,

Move d:\ftpSource\*.* d:\ETLSource

I have tried by creating a file system task, but there is no option

for Move Directory Contents. Move File is not accepting wild cards.

Regards,

Imran.

I struggled with this myself, and in the end I had to do 2 file system operations:

(1) copy directory - from source to destination

(2) delete directory contents - from source

HTH|||

Hi,

Sorry I cant move directory, because it is published over ftp. The way I already have done is (foreach loop over directory...Move file), but it is slow. Thanks for the hint, Now I will try file Object in Script task.

Thanks

Imran.