0% found this document useful (0 votes)
24 views

Clear Cache

This function clears temporary internet files, cookies, browsing history and deletes all files and subfolders except TD_80 in the temp folder to help restore a PC's health.

Uploaded by

Avisek Chowdhury
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Clear Cache

This function clears temporary internet files, cookies, browsing history and deletes all files and subfolders except TD_80 in the temp folder to help restore a PC's health.

Uploaded by

Avisek Chowdhury
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Call RestorePcHealth()

Function RestorePcHealth()
' Declare the object
Set WshShell = CreateObject("WScript.Shell")
' To clear Temporary Internet files
WshShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8"
wait(5)
'To clear browsing cookies
WshShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2"
wait(5)
'To Clear Browsing History
WshShell.run "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1"
wait(5)
Const TemporaryFolder = 2
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetSpecialFolder(TemporaryFolder)
' delete all files in temp folder
for each f in folder.Files
On Error Resume Next
name = f.name
f.Delete True
Next
' delete all subfolders and files from the temp folder
For Each f In folder.SubFolders
On Error Resume Next
name = f.name
If name<>"TD_80" Then
f.Delete True
'else
'msgbox "Cant Delete TD_80 folder"
End If
Next
End Function

You might also like