VBScript fso.deletefolder permission denied error on Vista
Posted on 2010-08-17
I want to add a function to delete the Outlook cache folder from my VBscript login script.
The additional code runs Ok but the folder is not deleted.
I took it out of the main body of the login script and tested separately and I get a permission denied error.
I have tested the script on another test folder on my desktop where I know I have permissions and it deletes the folder and displays the message.
Our PCs are Vista by the way...
Here is my script
dim WSHShell, fullpath, objFSO
Set WSHshell = CreateObject("WScript.Shell")
sCurrUsrPath = (fullpath & "\Appdata\Local\Microsoft\Windows\Temporary Internet Files\")
'Verify whether the Cache exists and delete it
If objFSO.FolderExists(sCurrUsrPath) Then
Const DeleteReadOnly = True
msgbox "The Cache has been cleared successfully"
msgbox "Cannot find the Cache. It may have been cleared already."
Thanks in advance for any help!