Java: Automatic Clearing of Java Cache
  • 1 Minute to read
  • Dark

Java: Automatic Clearing of Java Cache

  • Dark

 If SayIt / AgentAssist was launched from an executable (.exe) file instead of with Java Web Start, the instructions on this page are not applicable. 

These instructions are for administrators to configure Windows to automatically clear Java cache on an on-going basis. 

Java's performance can degrade after a while. Clearing the cache helps resolve the performance issue. The following script can be run to clear the cache for all user accounts on the computer. Optionally, you can configure the script to run at user login or set task scheduler to run the script how ever often you would like to clear the Java cache. If you need help, ask your IT department. 

Script must be run as administrator in order to run properly.
@Echo Off

set "docandset=%homedrive%\users"

     >> c:\Delete.log echo/ "Java\Deployment\cache\6.0\"

for /f "delims=" %%a in ('dir "%docandset%" /ad /b') do (

for %%b in (


) do (

echo %%b >> c:\Delete.log

cd /d %%b >> c:\Delete.log  2>&1

rd /s /q %%b >> c:\Delete.log  2>&1

del /f /s /q %%b >> c:\Delete.log  2>&1





To manually run the script:

  1. Copy and paste the script in the gray box above into a text editor, like Notepad. 
  2. Save it as a batch file (with a .bat file extension).
  3. Navigate to the location where you saved the file.


  1. Right-click on the .bat file and select Run as Administrator.


  1. At the prompt asking if you want to allow this app to make changes to your device, click Yes.
  2. Follow the instruction in the command prompt window.