Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help!  Cannot clear cache on client

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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Some time ago I faced the need to use a uniform folder structure that spanned across numerous sites of an enterprise to be used as a common repository for the Software packages of the Configuration Manager 2007 infrastructure. Because the procedu…
Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications.  The user can either have a desktop shortcut installed or go through the web portal to…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

885 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