FileSystemObject Problem

eagleversus

New member
Joined
Apr 12, 2005
Messages
3
Programming Experience
3-5
Ok i have a problem with the funtion copyfolder in vb.net

this my code

dim fso as FileSystemObject
fso= new FileSystemObject()
fso.CopyFolder("\\com1\tu\rt","d:\mio",true")
ok when i do that my program copy correct all the files and subfolders but if i do that:

fso.CopyFolder("\\com1\tu","d:\mio",true) my program can't copy the folder and all his content(folders,files,subfolders,etc.), because?

the errors that the program said me it's the follow:

myerror.source="Interop.Scripting"
myerror.message="The parameter is not correct"
and i believe that the type is System.ArgumentException

whats up? this error's it's in all the principal shared folder, only copy the second level to down an not the firts level to down example("\\com1\tc", presents the error, but if i put that "\\com1\tc\gh", its all correct)
 
Last edited:
well you could have the program get the manually copy the folders in the root directory then use System.IO.Directory.GetDirectories to get the subdirectories then you'd have to have the program make those subdirectories on your system then go to those sub directories and copy the folders

it'd be one big loop that you'd have to write but at least you know it's work when you get done lol

time permiting here i might be able to make a function for you sometime this week that does that
 
glad to see ya got it working, goes to show that i should familiarize myself with the FileSystemObject
 
Back
Top