Solved

Help!  Cannot clear cache on client

Posted on 2009-04-05
2
474 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Case Summary: In this Article we introduce the new method to configure the default user profile using Automated profile copy with sysprep rather than the old ways such as the manual copy of a configured profile to default user profile Old meth…
1. Boot PC and press F10, select storage options and change the compatibility from “AHCI” to “IDE”, save and exit 2. Boot PC and press F12 3. Upon PXE display of searching for DHCP server, press Pause break to obtain MAC address 3. Open Configu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

627 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