/build/static/layout/Breadcrumb_cap_w.png

Delete Java Cache for all users

We host software for one of our customers that makes heavy use of java. Unfortunately, the Java cache folder can get to be quite large. So, when you have several hundred user profiles on a terminal server, this can very quickly fill up the drive.

Can someone help me with a script that will forcefully delete the folders & all content in this folder for all users on a server:

C:\Documents and Settings\%UserName%\Application Data\Sun\Java\Deployment\cache

Thanks in advance,

Alicia

0 Comments   [ + ] Show comments

Answers (5)

Posted by: nikolofski1 15 years ago
Senior Yellow Belt
2
Hey VBScab, if you don't know how to solve Alicia's problem, don't answer...
You think that know everything but never answer nothing just have you tried to google it?

Google how to be polite

www.google.com 'how to be polite'
Posted by: wwals 15 years ago
Yellow Belt
1
Alicia,

I believe something simple like:
for /d %d in ("c:\documents and settings\*") do rd /s/q "%d\Application Data\Sun\Java\Deployment\cache"

Will do what you need from a standard commandline.

If you want a little more control:
C:\> del cleanup.bat
C:\> for /d %d in ("c:\documents and settings\*") do echo >>cleanup.bat rd /s/q "%d\Application Data\Sun\Java\Deployment\cache"
then after checking the commandfile cleanup.bat (in you favority editor), execute it.
C:\> cleanup.bat

Using vbscript or powershell much more elaborate and fancy solutions can be build, but in general... Keep It Simple Stupid (KISS method) works!

You might also want to think about making a logout script for every user which will just do a: rd /s/q "%username%\Application Data\Sun\Java\Deployment\cache"
so that every time a user logout from the terminal server he/she cleansup its cache.

Comments:
  • I know this is old, but I wanted to give my input in case anyone comes across this in the future. Your "something simple" solution worked great for me! Only thing is in batch '%d' needs to be replaced with '%%d' - adaml 10 years ago
Posted by: anonymous_9363 16 years ago
Red Belt
0
All you need to do is find a script which recursively walks a folder tree. Then you can add whatever action you want by editing it. There are literally thousands of examples available. Try Googling for 'VBScript +folder +recurse' or 'VBScript +folder +recursive'
Posted by: turbokitty 15 years ago
6th Degree Black Belt
0
http://itninja.com/question/vb-script-for-office-2003-silent-install8
Posted by: anonymous_9363 15 years ago
Red Belt
-2
My friend, are you familiar with the phrase "re-inventing the wheel"? I have written more pages of code than you could shake a stick at but I see little point in reproducing code here that can be obtained in less than a minute by using tools available to everyone.

Finally:
a) it's nice to know that you have gone through every one of my 2900-odd posts and come to the conclusion that all I do is point people at Google. Still enough people have been happy enough with my responses to award me points, so I figure I'm doing something right; and
b) you seem unfamiliar with the concept of 'signatures' in fora (that's the correct plural form for 'more than one forum', BTW). It's my signature that contains the helpful hint that a good proportion of questions posted here (and elsewhere) could be answered in a lot less time by the simple expedient of undertaking some basic research.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ