Link to home
Start Free TrialLog in
Avatar of vbnewbie01
vbnewbie01

asked on

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.
Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
Avatar of vbnewbie01
vbnewbie01

ASKER

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.



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".
ASKER CERTIFIED SOLUTION
Avatar of CooPzZ
CooPzZ
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
arrrg!