ibrafe Posted August 18, 2014 Report post Posted August 18, 2014 Hi I have been tasked to deploy application to users machines via sccm 2012. One of the requirements is that when the application is installed, We have to delete it from the ccmcache. The following scripts does the job but as you can see but the detection method is making loose my hair. It works on the 1st deployment but if I deploy another application and use the same script. It detects sccmcachecleaner folder and flags it as a success hense nothing is installed My application is configured to with 2 deployment types with priority 1 as the script and priority 2 with the actual app. The 1st deployment type is has a dependency to the 2nd deployment type. The software we are deploying are license restricted and we don't want people digging through the ccmcache to steal the applications. Any ideas will help on error resume nextdim oUIResManagerdim oCachedim oCacheElementdim oCacheElementsset oUIResManager = createobject("UIResource.UIResourceMgr")if oUIResManager is nothing then wscript.echo "Couldn't create Resource Manager - quitting" wscript.quitend ifset oCache=oUIResManager.GetCacheInfo()if oCache is nothing then set oUIResManager=nothing wscript.echo "Couldn't get cache info - quitting" wscript.quitend ifset oCacheElements=oCache.GetCacheElementsfor each oCacheElement in oCacheElementsoCache.DeleteCacheElement(oCacheElement.CacheElementID)nextset oCacheElements=nothingset oUIResManager=nothingset oCache=nothingSet objFSO = CreateObject("Scripting.FileSystemObject")Set objFolder = objFSO.CreateFolder("C:\Windows\Temp\sccmcachecleaner") Quote Share this post Link to post Share on other sites More sharing options...