pruebens Posted December 16, 2002 Posted December 16, 2002 I'm trying to copy a users favorites directory up to the network using the follwing code: Directory.Move("C:\Documents and Settings\" & userID & "\Favorites", "H:\favorites") When this executes I get the following error: Source and destination path must have identical roots. Move will not work across volumes. Which obviously means I'm using the wrong command. Could someone please fill me in on what command I need to use? Thanks. Quote
*Gurus* divil Posted December 16, 2002 *Gurus* Posted December 16, 2002 There is no member of the Directory class to copy a whole directory, you'll have to do it manually, file by file using File.Copy. If you need to do subdirectories as well your code will have to recurse on itself. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
theWul Posted November 13, 2003 Posted November 13, 2003 ready to go code at: http://www.codeproject.com/csharp/copydirectoriesrecursive.asp Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.