i have a code below. it goes through all the folders but when it gets to the folder it doesnt have rights to, it gets killed. i want it to be skip that folder it doesnt have right to and move to the next folders....
Set objShell = CreateObject("WScript.Shell")
strProfile = objShell.ExpandEnvironmentStrings("%USERPROFILE%")
strFolder = strProfile & "Cookies"
intDaysOld = 60
dteDate = DateAdd("d", intDaysOld, Now)
Set objFSO = CreateObject("Scripting.FileSystemObject")
For Each objFile In objFSO.GetFolder(strFolder).Files
If objFile.DateLastModified < dteDate Then
On Error Resume Next
objFSO.DeleteFile objFile.Path, True
On Error GoTo 0