To Clear SCCM / SMS CCM / Cache Folder
' Script to Clear SMS cache files
on error resume next
dim oUIResManager
dim oCache
dim oCacheElement
dim oCacheElements
set oUIResManager = createobject("UIResource.UIResourceMgr")
if oUIResManager is nothing then
'      wscript.echo "Couldn't create Resource Manager – quitting"
end if
set oCache=oUIResManager.GetCacheInfo()
if oCache is nothing then
     set oUIResManager=nothing
'      wscript.echo "Couldn't get cache info – quitting"
end if
set oCacheElements=oCache.GetCacheElements
'wscript.echo "There are " & oCacheElements.Count & " cache elements"
' ***** Begin CLEAR CACHE *****
for each oCacheElement in oCacheElements
' ***** End CLEAR CACHE *****
' ***** Clean up *****
set oCacheElements=nothing
set oUIResManager=nothing
set oCache=nothing


Leave a Reply

Your email address will not be published. Required fields are marked *