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
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)
Please log in to answer
Posted by:
nikolofski1
15 years ago
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'
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
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.
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
Posted by:
turbokitty
15 years ago
Posted by:
anonymous_9363
15 years ago
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.
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.
so that the conversation will remain readable.