July 7, 2010 at 10:19 am
I need to use 'net use' to map a network drive as a step in the SSIS package, before I can copy the file to the mapped network drive.
Is there any easy way to do this? Will the 'Execute Process Task' help? Or do I need to write VBscript in order to use 'Script Task' for this purpose. I am not very good at writing VBscript.
Thanks for any help!
July 7, 2010 at 10:22 am
Why not just use a straight UNC path?
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
July 7, 2010 at 10:33 am
I would like to use UNC path, but the 'File System Task' does not allow me put UNC path. It may because that the source server is not in the same domain as the destination server.
July 7, 2010 at 10:50 am
Really - OK, use a Script Task.
Here's some code:
Public Sub Main()
'
' Add your code here
'
Dim FileToCopy As String
Dim NewCopy As String
FileToCopy = "C:\temp\test.txt"
NewCopy = "C:\temp\NewTest.txt"
If System.IO.File.Exists(FileToCopy) = True Then
System.IO.File.Copy(FileToCopy, NewCopy)
End If
Dts.TaskResult = ScriptResults.Success
End Sub
Replace the whole of the default Public Sub Main / End Sub block with the code above.
Then modify the two lines FileToCopy = and NewCopy = to contain source and destination UNC.
Should then be good to go.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
July 7, 2010 at 12:40 pm
Thanks for the solution!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply