G
Guest
I haven't done a lot of file I/O in .NET and thought I had this figured out.
I am simply wanting to move a UNC-based directory path to a new path using
DirectoryInfo.
Example:
Source directory I want to move:
\\server\share1\MyDir
to:
\\server\share2\MyDir
I am attempting to do this via the following code:
Dim d As New DirectoryInfo(SrcDirectory)
d.MoveTo(TgtDirectory)
However this throws the error "Source and destination path must have
identical roots. Move will not work across volumes".
I understand the error as "\server\share2" and "\server\share1" represent
different roots. So my question is how, using .NET 2.0, do I move a
directory across volumes? This seems like it SHOULD be so simple. Is there
something I'm missing?
TIA.
I am simply wanting to move a UNC-based directory path to a new path using
DirectoryInfo.
Example:
Source directory I want to move:
\\server\share1\MyDir
to:
\\server\share2\MyDir
I am attempting to do this via the following code:
Dim d As New DirectoryInfo(SrcDirectory)
d.MoveTo(TgtDirectory)
However this throws the error "Source and destination path must have
identical roots. Move will not work across volumes".
I understand the error as "\server\share2" and "\server\share1" represent
different roots. So my question is how, using .NET 2.0, do I move a
directory across volumes? This seems like it SHOULD be so simple. Is there
something I'm missing?
TIA.