Perform a Looping file.copy
Posted on 2005-04-22
I am trying to perform a simple file.copy - however, I want to perform the action for multiple destinations - is there a way to loop through and perform an action for each of the below
Dim sSorurce As String = "\\SERVER1\c$\INETPUB\WWWROOT\REPORTING\CONNECTIONS\Field_GP.dsn"
Dim sDestination1 As String = "\\SERVER2\c$\INETPUB\WWWROOT\REPORTING\CONNECTIONS\Field_GP.dsn"
Dim sDestination2 As String = "\\SERVER3\c$\INETPUB\WWWROOT\REPORTING\CONNECTIONS\Field_GP.dsn"
Dim sDestination3 As String = "\\SERVER4\c$\INETPUB\WWWROOT\REPORTING\CONNECTIONS\Field_GP.dsn"
File.Copy(sSorurce, sDestination1, True)
File.Copy(sSorurce, sDestination2, True)
File.Copy(sSorurce, sDestination3, True)
What I would like to do, in place of having to perform an explicit file.copy for each destination - somehow loop through complete it for each defined location / destination