Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The built-in Desktop and Documents folders are backed up to root folder on a locally external device.Periodically,the child node folder containing the built-in Desktop and Documents folded has has to be deleted in order that capacity integrity is maintained.In order to accomplish this task a vbscript was designed and implemented.The built-in Desktop folder along with its sub-folders,files and its contents are deleted successfully.However, the built-in Documents folder is not being deleted only its sub-folders,files and contents are being successfully deleted. I have full Administrator's privileges on all folders on both pc and external backup device.The pc is not apart of any domain and it is also not shared.Here is a snippet of the code

if (objFSO.FolderExists(strBackupFoldToDelete & strInternationalDate)) then
objFSO.DeleteFolder(strBackupFoldToDelete & strInternationalDate)
strBackUpStart = strBackUpStart + 1
'checking for several instances
else
strBackUpStart = strBackUpStart + 1
end if

The error encountered is
Line: 10
Char: 1
Error: Permission denied
Code: 800A0046
Source: Microsoft VBScript runtime error

I have been attempting to resolve this anomaly for several weeks but to no avail.Any assistance would be most graciously appreciated

What I have tried:

All folders have Administrator's full control permission
Posted
Updated 28-Apr-19 10:27am
Comments
phil.o 30-Apr-19 7:55am    
"the child node folder containing the built-in Desktop and Documents folded"

Do you mean user's profile folder? As far as I know, you can only do it when said user has closed his/her session.

I wonder if storing "Documents" folder in a network share would not be more suitable here. And the desktop folder should not be of such weight (who would put a caterpillar on his desk?).

1 solution

I do not know but one guess is that something is holding on to the root folder. Maybe an explorer window is has the folder open. Maybe a command prompt has it as current directory. Or perhaps your own application has it as "current dir". Just guessing...
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900