Solved

Help!  Cannot clear cache on client

Posted on 2009-04-05
2
465 Views
Last Modified: 2013-11-21
I am trying to get the below script to clear out cache on local sms clients.  So far nothing works.   I ran the script manually on the local client and it runs fine.  Please see the below script and program properties  to see if anything jumps out as a problem:

CMD Line:   csricpt.exe clearcache.vbs
-Run Normal
-Run Whether or not a user is logged in
-Download from DP
-Data Source: Use a compressed copy of the source directory.

SCRIPT:

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

Open in new window

0
Comment
Question by:net1994
2 Comments
 
LVL 6

Expert Comment

by:question
Comment Utility
This is perfrctly fine. I have akso used the same script to clear old junk cache..

http://www.myitforum.com/forums/m_155917/mpage_1/key_/tm.htm#155917

Also see the below to get a better insight of the troubleshooting in case

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Systems_Management_Server/Q_23266832.html
0
 
LVL 1

Accepted Solution

by:
net1994 earned 0 total points
Comment Utility
I found the issue.  When running on the client I had it download from DP, which would then try to delete itself in the middle of the script running. Not good.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Have you considered what group policies are backwards and forwards compatible? Windows Active Directory servers and clients use group policy templates to deploy sets of policies within your domain. But, there is a catch to deploying policies. The…
Know what services you can and cannot, should and should not combine on your server.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now