Skip to content

CM12 Vbscript detection method

Featured Replies

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 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"
wscript.quit
end if

set oCache=oUIResManager.GetCacheInfo()

if oCache is nothing then
set oUIResManager=nothing
wscript.echo "Couldn't get cache info - quitting"
wscript.quit
end if

set oCacheElements=oCache.GetCacheElements

for each oCacheElement in oCacheElements
oCache.DeleteCacheElement(oCacheElement.CacheElementID)
next

set oCacheElements=nothing
set oUIResManager=nothing
set oCache=nothing

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.CreateFolder("C:\Windows\Temp\sccmcachecleaner")

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.