Is there a way to recursively copy a folder (including all sub-folders and files)? I see there is a Folder.DeleteTree, so maybe there is something like Folder.CopyTree(String source, String destination)? Or if there isn't a direct way to do this, could someone suggest a way I might implement this myself using existing functionality? I am running version 7.5.1004.0.
Announcement
Collapse
No announcement yet.
Recursive Folder Copy Function?
Collapse
X
-
Found it
I found the code that appears to be working well here https://www.indigorose.com/forums/showthread.php?t=6797
Sorry about that.
-
theme and extension to the C: \ Windows \ Resources \ Themes want to copy into
if CopyFolder ("AutoPlay \ \ Docs \ \ Milan", "C:\\Windows\\Resources\\Themes") == 0 then
result = Dialog.Message ("Theme Applied", "Personalize your desktop, right-click and select the theme, saying.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
endLast edited by milano88; 11-14-2010, 02:35 PM.
Comment
-
I use version 8 but as far I know the function "CopyFolder" does not exist.
The function to copy folder contents is File.Copy (<source>, <destination>, <recurse subfolders>, and other options...).
Because File.Copy does returns nothing, you should use Application.GetLastError () to determine whether this action failed, and why.
So, your code should be:
Code:File.Copy ("AutoPlay\\Docs\\Milan", "C:\\Windows\\Resources\\Themes\\*.*", true); if Application.GetLastError () == 0 then result = Dialog.Message ("Theme Applied", "Personalize your desktop, right-click and select the theme, saying.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end
We are slowly invading your planet to teach lazy humans to read the user manual.
But don't be scared: we are here to help.
Comment
Comment