Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help!  Cannot clear cache on client

Posted on 2009-04-05
2
Medium Priority
?
475 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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

Problem Description: Actually I found the below issue with some customers after migration from SMS 2003 to SCCM 2007 and epically if they change site code, some clients may appear in the console with old site code, plus old sites still appearing …
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

721 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