1

At work, we regularly need to use the Java Control Panel to clear Java's Temporary Internet Files while testing legacy Java applications. Since we frequently need to clear the Java Cache, I want to create a shortcut for clearing the cache on Windows.

A similar question on Stack Overflow discussed how to programmatically clear Java's temporary internet files, but this isn't much help, as I do not have developer access to make code modifications.

How can I create a shortcut for clearing Java's temporary internet files?

Java's temporary internet files

2

How can I create a shortcut for clearing Java's temporary internet files?

Windows 7 or later batch file:

for /D %%a in (*.*) do DEL /F /S /Q "%%a\AppData\LocalLow\Sun\Java\Deployment\cache\*.*"
for /D %%a in (*.*) do FOR /D %%b IN ("%%a\AppData\LocalLow\Sun\Java\Deployment\cache\*.*") DO RMDIR /S /Q "%%b"

Windows XP batch file:

for /D %%a in (*.*) do DEL /F /S /Q %%a\Application Data\Sun\Java\Deployment\cache\*.*"
for /D %%a in (*.*) do FOR /D %%b IN (%%a\Application Data\Sun\Java\Deployment\cache\*.*) DO RMDIR /S /Q "%%b

Source Cleanup Windows & Java Temporary Files using a Batch Script

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.