How to copy a root directory (copy a flash drive) and paste it somewhere else?
-
Hello:confused:, I'm having this problem to where I cannot copy a root directory (e.g.,J:\, F:\, V:\, E:\ <--Common removable drive roots) of a flash drive onto a specific area of the main hard drive on my computer. It's basically copying the drive "J:\" to "C:\Flash Backup\Current date and time" on my computer, but I'm facing a problem, while compiling and debugging it gives me the error: Could not complete operation since directory is a root directory: 'C:\'.... is there anyway around this? I'm using the following line of code to copy it: Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(directory to copy from, where to copy, some other stuff that are boolean values) Any help would be greatly appreciated...:thumbsup: Regards, Brandon T. H. Codeproject Member
-
Hello:confused:, I'm having this problem to where I cannot copy a root directory (e.g.,J:\, F:\, V:\, E:\ <--Common removable drive roots) of a flash drive onto a specific area of the main hard drive on my computer. It's basically copying the drive "J:\" to "C:\Flash Backup\Current date and time" on my computer, but I'm facing a problem, while compiling and debugging it gives me the error: Could not complete operation since directory is a root directory: 'C:\'.... is there anyway around this? I'm using the following line of code to copy it: Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(directory to copy from, where to copy, some other stuff that are boolean values) Any help would be greatly appreciated...:thumbsup: Regards, Brandon T. H. Codeproject Member
Hi. I think your problem comes with WNet security implementation exploited by your Runtime (viewing code, I denote .NET but don't know what release). Perhaps making a 'net use ...' first, could solve the IOException. If not, here you can find information : http://msdn.microsoft.com/en-us/library/Aa385413[^] Hope it helps! Regards