02-24-2012, 10:35 AM
Hi,
Try the below code.
Regards,
Ankesh
Try the below code.
Code:
Function ClearCookies()
On Error Resume Next
Const TEMPORARY_INTERNET_FILES = "&H20&"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TEMPORARY_INTERNET_FILES)
objFSO.DeleteFile(objFolder.Self.Path & "\*.*")
sPath = objFSO.GetFolder(objFolder.Self.path) & "\Content.IE5\"
Set objFolders = objFSO.GetFolder(sPath)
For Each objFName In objFolders.SubFolders
WScript.Echo sPath & objFName.Name
objFSO.DeleteFolder(sPath & objFName.Name)
Next
If Err.Number <> 0 Then
err.Clear
ClearCookies = 0
Else
ClearCookies = 1
End If
End Function
Regards,
Ankesh