Scripting Clean Java Temporary Install Files From User Profiles Win 7 Xp
So I had an issue awhile back that need to be rectified and the fix was to clean out temporary install files from the Sun/Java folder in User profiles. This had to be done on about 700 machines, so I created this little script that cleans out these files and pushed it out to via AD. I hope you enjoy…..
Win 7 - Clean Java Temp FilesCD C:\CLSECHOREM *** This DELETES temporary install files from the REM *** SUN/JAVA folder in User Profiles. REM *** Run this if you get a Pop-Up warning about your REM *** User Profile being too large. REM *** Click the corner [X ] to exit without running. REM *** Otherwise press the [Spacebar ] to continue.PAUSEDEL "%USERPROFILE%\AppData\LocalLow\Sun\Java\*.*" /S /F /QRD "%USERPROFILE%\AppData\LocalLow\Sun\Java\" /S /QDEL "%USERPROFILE%\AppData\Local\Temp\*.*" /S /F /QRD "%USERPROFILE%\AppData\Local\Temp\" /S /QCLSREM *** Folders are cleaned!PAUSEEXIT
Win XP - Clean Java Temp FilesCD C:\CLSECHOREM *** This script is for Windows XP only it will NOT work on Vista or 7 REM *** This DELETES temporary install files from the REM *** SUN\JAVA and Local Settings\Temp folders in User Profiles. REM *** Run this if you get a Pop-Up warning about your REM *** User Profile being too large. REM *** Click the corner [X ] to exit without running. REM *** Otherwise press the [Spacebar ] to continue.PAUSEDEL "%SYSTEMDRIVE%\Documents and Settings\%USERNAME%\Application Data\Sun\Java\*.*" /S /F /QRD "%SYSTEMDRIVE%\Documents and Settings\%USERNAME%\Application Data\Sun\Java\" /S /QDEL "%SYSTEMDRIVE%\Documents and Settings\%USERNAME%\Local Settings\Temp\*.*" /S /F /QRMDIR "%SYSTEMDRIVE%\Documents and Settings\%USERNAME%\Local Settings\Temp\" /S /QCLSREM *** Folders are cleaned!PAUSEEXIT