Hello
I am trying to copy my Document folder complete with subdirectories and all files in the root and them to another (backup) drive.
First I tick the Microsoft Scripting Runtime in the IDE at Project/References.
A portion of the code then is
When I run this, after a while (in which it is apparent that at least some of the subdirectories and their files are being copied) the process halts with Runtime Error 70 (permission denied). I would think that one (or more files) in my Documents file has insufficient permission to be copied.
1) What I'd like to is either
a) Find the name of the file concerned and manually change the permission
or
b) Ignore the permission limitation and copy anyway
or
c) (as a very last resort as I want my backup to be complete) jump over the file (and any others with similar limitations.
2) If possible, I'd quite like to display the actual filenames in listbox while being copied but can't see how to do that in the recursive code (I can do it fine when just copying files in the root directory and not using FileSystemObject.
Thanks
I am trying to copy my Document folder complete with subdirectories and all files in the root and them to another (backup) drive.
First I tick the Microsoft Scripting Runtime in the IDE at Project/References.
A portion of the code then is
Code:
aSourcePath = "C:\Users\Alan\Documents\*.*" 'source + wildcard (for scripting)
aDestinationPath = aDestinationDrive & "\My Docs backup\" ' selected backup drive + dir
...
Dim fso As New FileSystemObject
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFolder aSourcePath, aDestinationPath, True
1) What I'd like to is either
a) Find the name of the file concerned and manually change the permission
or
b) Ignore the permission limitation and copy anyway
or
c) (as a very last resort as I want my backup to be complete) jump over the file (and any others with similar limitations.
2) If possible, I'd quite like to display the actual filenames in listbox while being copied but can't see how to do that in the recursive code (I can do it fine when just copying files in the root directory and not using FileSystemObject.
Thanks