Solved

Help!  Cannot clear cache on client

Posted on 2009-04-05
2
471 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Expert Comment

by:question
ID: 24119811
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
ID: 24250251
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Every system administrator encounters once in while in a problem where the solution seems to be a needle in haystack.  My needle was an anti-virus version causing problems with my Exchange server. I have an HP DL350 with Windows Server 2008 Stand…
On a regular basis I get questions about slow RDP performance, RDP connection problems, strange errors and even BSOD, remote computers freezing or restarting after initiation of a remote session. In a lot of this cases the quick solutions made b…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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