Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
script for deleting cookies
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
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
Reply


Messages In This Thread
script for deleting cookies - by mrajeshtnl - 02-24-2012, 06:49 AM
RE: script for deleting cookies - by Ankesh - 02-24-2012, 10:35 AM
RE: script for deleting cookies - by mrajeshtnl - 02-24-2012, 07:33 PM
RE: script for deleting cookies - by inborntester - 02-24-2012, 10:41 AM
RE: script for deleting cookies - by ravi.gajul - 02-24-2012, 11:58 AM
RE: script for deleting cookies - by rkkumar - 03-06-2012, 12:36 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)