Micro Focus QTP (UFT) Forums
How to delete contents of temp internet folder - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to delete contents of temp internet folder (/Thread-How-to-delete-contents-of-temp-internet-folder)



How to delete contents of temp internet folder - vimalatanvashi - 02-10-2009

Hi,
I have written a script which will delete folders and files from temporary internet folder. How to delete other contents such as CMS file, GIF Image files? I want to delete all contents from the internet folder.
Please suggest..
Code:
s="D:\Documents and Settings\Local Settings\Temporary Internet Files"
Set fso=createobject("scripting.filesystemobject")
Set fpath=fso.getfolder(s)
set fsubfolder=fpath.subfolders
folcount=0
For each s1 in  fsubfolder
    s = s & s1.name
    ss=fso.getfolder(s1)
    'msgbox ss
      On Error Resume Next
    fso.deletefolder(ss)
    folcount=folcount+1
    'msgbox s
    'msgbox folcount
    Next
'  ShowFolderList = s
'     msgbox ShowFolderList
     msgbox "total number of folders:  " & folcount 'total nomber of folders