user1804925
user1804925

Reputation: 159

File not copy to correct directory

I am trying to copy a file from a network drive then move to the different folder. Somehow is not moving the file to the directory I specified. After executing the read file code, the file is copy in the same directory.(see pic)

I have try the same code from my local drive and it works fine.

                    'copy the file
                File.Copy(Path.Combine("\\swnas.swmed.org\Phytel\", Dts.Variables("File").Value.ToString), Path.Combine("\\swnas.swmed.org\Phytel\Raw\MCKPP\Processed", insertNewName), True)

                'read the file
                objStreamReader = New StreamReader(Path.Combine("\\swnas.swmed.org\Phytel\Raw\MCKPP\Processed", insertNewName))

                'overwrite the file
                objWriter = New StreamWriter(Dts.Variables("File").Value.ToString, False)

enter image description here

Upvotes: 0

Views: 46

Answers (1)

corey
corey

Reputation: 26

I'd take a minute and make sure there are no odd permission rules being applied to the directory you are copying/moving to.

Upvotes: 1

Related Questions