copy folder

hi there; using asp.net (vb), i'd like to copy a folder to a different folder.  i can create the folder, then copy the individual files one by one, no problem, but there are many of them and i'd rather copy the whole folder at once.

suggestions?

thanks.
LVL 1
vbnewbie01Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Richard QuadlingSenior Software DeveloperCommented:
Hi william007,

Sounds daft, but if you CAN copy all the files and folders one at a time, you ARE copying the entire folder! What happens if you just use folder names rather than files?    

Regards,

Richard Quadling.
vbnewbie01Author Commented:
hey there; thanks for the response ...

nothing happens when i use the folder name.

here, i create the folder:

Dim myThemeImagesFolder as New DirectoryInfo(server.mappath("..\admin\createFolder\" & intListingID & "\themes\5\images\"))
myThemeImagesFolder.Create()


and here is where i try to copy the existing folder to the new destination:

dim strImageSource as string = Server.MapPath("..\themes\5\images")
dim strImageDestination as string = Server.MapPath("..\admin\createFolder\" & intListingID & "\themes\5\images")
File.Copy(strSource, strDestination, true)


i also tried by not initially creating the folder and just running the copy part ... nothing happened.



vbnewbie01Author Commented:
sorry ... that last part should read:

dim strImageSource as string = Server.MapPath("..\themes\5\images")
dim strImageDestination as string = Server.MapPath("..\admin\createFolder\" & intListingID & "\themes\5\images")
File.Copy(strImageSource, strImageDestination, true)

and this creates the following error:
Could not find file "c:\inetpub\wwwroot\application\themes\5\images".
CooPzZSoftware DeveloperCommented:

well in .net thats how to do it.. manually so you have to write the procedure to do it yourself...

you could use the scripting.filesystemobject  com object that has a copy folder procedure or if your in for a real challenge you can use some apis

But when It comes down it it under the scenes you do it one by one anyway.. this way you can control how you want it to work.

CooPzZ

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vbnewbie01Author Commented:
arrrg!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.