Kaseya Community

Clean temporary internet files in *ALL* user profiles

  • Here is a script using a utility called ICSweep to clean all profiles temporary internet files. You'll need to download the ICSWeep utility from http://www.ctrl-alt-del.com.au/CAD_Utils.htm, and add it to your shared files in order for this to work.

    It works great for Terminal/Citrix servers, as it will clear any profile that is not currently in use of temporary internet files. I ran this at one of our clients, and freed up almost 4GB of disk space.



    Script Name: Clean Temporary Internet Files (TS)
    Script Description: This script will use the ICSweep utility to Clear all temporary internet files in all user profiles that are not currently open.

    ICSweep comes from http://www.ctrl-alt-del.com.au/CAD_Utils.htm

    IF True
    THEN
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : TEMPPATH
    OS Type : 0
    Write File
    Parameter 1 : #TEMPPATH#\ICSweep.exe
    Parameter 2 : VSASharedFiles\ICSweep.exe
    OS Type : 1
    Execute Shell Command
    Parameter 1 : #TEMPPATH#\ICSweep.exe >> #TEMPPATH#\icsweep.log
    Parameter 2 : 1
    OS Type : 1
    Get Variable
    Parameter 1 : 1
    Parameter 2 : #TEMPPATH#\icsweep.log
    Parameter 3 : ICSWEEP
    OS Type : 1
    Write Script Log Entry
    Parameter 1 : ICSWeep Ran #ICSWEEP#
    OS Type : 1
    ELSE






    Legacy Forum Name: Clean temporary internet files in *ALL* user profiles,
    Legacy Posted By Username: Jonathan
  • Nice little utility. Seems it could be used inconjuction with other utlities out there such as CCleaner. Nice find.

    God Bless,

    Marty


    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: MissingLink
  • I have a batch file that does the same task, simple three-liner. It's easily modified for other drive letters, or for NT4 where profiles aren't in C:\Documents and Settings



    *************Begin********************

    SET SRC1=C:\Documents and Settings
    SET SRC2=Local Settings\Temporary Internet Files\Content.IE5
    FOR /D %%X IN ("%SRC1%\*") DO FOR /D %%Y IN ("%%X\%SRC2%\*.*") DO RMDIR /S /Q "%%Y"


    **************end***************


    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: agilitynetworks
  • I actually wrote a little command line utility in VB some time ago that deletes all temporary internet files from all profiles, all temp files from all profiles, and all Windows temp files. You can specify which via the command line options.

    It needs a little more fixing and testing; it has some trouble with certain hidden and/or read only subfolders.




    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: warever