Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: Biju Thomas
  Where is Biju Thomas?
 Kochi
 India
 Biju Thomas
 Tags
Subject: RE: Copying Folders & sub folders at once
Thread ID: 175620 Message ID: 181843 # Views: 26 # Ratings: 0
Version: Visual FoxPro 8 Category: Win32API programming
Date: Sunday, July 06, 2008 2:03:20 AM         
   


> Hello Everybody,
> I have a folder called 'myfolder' and the 'myfolder' have lot of sub folder and files in those sub folders. I want to copy the entire 'myfolder' along with the sub folders & files in it to another destination say D:\. It can not be predicted how many sub folders & files are there while copying. Kindly help. I do not want to depend on Xcopy.
> With Regards,
> Biju Thomas

YOUSFI BENAMEUR

YOU CAN USE THIS SHELL CODETO COPY A FOLDER SOURCE TO A DESTINATION FOLDER
The following code copies all files from the source folder to the target folder.

LOCAL oShell, oSrcFolder, oDstFolder
mkdir c:\temp       &&create folder if not exist

oShell = CREATEOBJECT("Shell.Application")
oSrcFolder = oShell.NameSpace(getdir())
oDstFolder = oShell.NameSpace("c:\temp")     

IF VARTYPE(oDstFolder)="O" AND VARTYPE(oSrcFolder.Items)="O"  && folders must exist
        oDstFolder.CopyHere(oSrcFolder.Items)
ENDIF


COMPLETE THREAD

Copying Folders & sub folders at once Posted by Biju Thomas @ 5/29/2008 11:02:04 AM
RE: Copying Folders & sub folders at once Posted by surinder singh @ 5/29/2008 11:10:52 AM
RE: Copying Folders & sub folders at once Posted by Andy Kramek @ 5/29/2008 12:25:08 PM
RE: Copying Folders & sub folders at once Posted by Biju Thomas @ 5/29/2008 7:17:00 PM
RE: Copying Folders & sub folders at once Posted by Andy Kramek @ 5/29/2008 9:34:40 PM
RE: Copying Folders & sub folders at once Posted by Biju Thomas @ 5/30/2008 5:05:32 AM
RE: Copying Folders & sub folders at once Posted by Andy Kramek @ 5/30/2008 12:31:55 PM
RE: Copying Folders & sub folders at once Posted by Pete Sass @ 5/29/2008 11:02:34 PM
RE: Copying Folders & sub folders at once Posted by Biju Thomas @ 6/2/2008 5:52:03 PM
RE: Copying Folders & sub folders at once Posted by Biju Thomas @ 6/2/2008 5:52:43 PM
RE: Copying Folders & sub folders at once Posted by Pete Sass @ 6/2/2008 11:34:46 PM
RE: Copying Folders & sub folders at once Posted by Biju Thomas @ 6/8/2008 7:12:07 PM
RE: Copying Folders & sub folders at once Posted by Samir Ibrahim @ 6/4/2008 5:49:28 PM
RE: Copying Folders & sub folders at once Posted by Srdjan (Sergio) Djordjevic @ 6/9/2008 2:34:30 PM
RE: Copying Folders & sub folders at once Posted by Biju Thomas @ 7/3/2008 6:19:36 PM
RE: Copying Folders & sub folders at once Posted by Yousfi Benameur @ 7/6/2008 2:03:20 AM